mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-11-30 09:55:32 +00:00
feat: bukkit metapacks and clean up
This commit is contained in:
1 parent
dcf38956c4
commit
02c2176222
36 files changed
+1026
-230
No files matched your search
+7
-3
@@ -30,9 +30,8 @@ public final class BiomeTags {
|
||||
public record PlatformTagSource(AttributeReport report, String config, Set<RegistryKey> tags) { }
|
||||
|
||||
public static void addTerraBiomes(Map<TagKey<Biome>, List<Holder<Biome>>> collect,
|
||||
Function<Identifier, Optional<Holder<Biome>>> lookup,
|
||||
Map<Identifier, List<Identifier>> byParent, Map<Identifier, PlatformTagSource> platformTags) {
|
||||
byParent.forEach((vb, terraBiomes) ->
|
||||
Function<Identifier, Optional<Holder<Biome>>> lookup, TerraBiomeIndex biomes) {
|
||||
biomes.byParent().forEach((vb, terraBiomes) ->
|
||||
lookup.apply(vb).ifPresentOrElse(
|
||||
vanilla -> terraBiomes.forEach(tb -> lookup.apply(tb).ifPresentOrElse(
|
||||
terra -> {
|
||||
@@ -42,7 +41,12 @@ public final class BiomeTags {
|
||||
},
|
||||
() -> logger.error("No such biome: {}", tb))),
|
||||
() -> logger.error("No vanilla biome: {}", vb)));
|
||||
addPlatformTags(collect, lookup, biomes.tags());
|
||||
}
|
||||
|
||||
public static void addPlatformTags(Map<TagKey<Biome>, List<Holder<Biome>>> collect,
|
||||
Function<Identifier, Optional<Holder<Biome>>> lookup,
|
||||
Map<Identifier, PlatformTagSource> platformTags) {
|
||||
Set<TagKey<Biome>> existing = new HashSet<>(collect.keySet());
|
||||
platformTags.forEach((tb, source) -> {
|
||||
if(source.tags().isEmpty()) return;
|
||||
|
||||
+6
@@ -70,6 +70,12 @@ public final class MinecraftAttributeParents implements AttributeParents {
|
||||
return state.context();
|
||||
}
|
||||
|
||||
public VanillaContext requireContext() {
|
||||
VanillaContext context = state.context();
|
||||
if(context == null) throw new IllegalStateException("no registry load has begun");
|
||||
return context;
|
||||
}
|
||||
|
||||
public PackParents prepare(ConfigPack pack, Optional<PackAttributes> attributes, AttributeReport report) {
|
||||
return prepare(pack, attributes, report, BuiltinDimensionTypes.OVERWORLD);
|
||||
}
|
||||
|
||||
+8
@@ -14,9 +14,11 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.dfsek.terra.api.config.ConfigPack;
|
||||
import com.dfsek.terra.api.registry.key.RegistryKey;
|
||||
import com.dfsek.terra.api.world.attribute.Attribute;
|
||||
import com.dfsek.terra.api.world.attribute.AttributeEntry;
|
||||
@@ -33,6 +35,12 @@ public final class MinecraftBiomeFactory {
|
||||
private final VanillaContext context;
|
||||
private final VanillaAttributeMaps maps;
|
||||
|
||||
public static Identifier terraId(ConfigPack pack, RegistryKey biome) {
|
||||
return Identifier.fromNamespaceAndPath("terra", pack.getID().toLowerCase(Locale.ROOT) + "/"
|
||||
+ biome.getNamespace().toLowerCase(Locale.ROOT) + "/"
|
||||
+ biome.getID().toLowerCase(Locale.ROOT));
|
||||
}
|
||||
|
||||
public MinecraftBiomeFactory(AttributeHandle handle, VanillaContext context) {
|
||||
this.handle = Objects.requireNonNull(handle, "handle");
|
||||
this.context = Objects.requireNonNull(context, "context");
|
||||
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
package com.dfsek.terra.minecraft.attribute;
|
||||
|
||||
import net.minecraft.resources.Identifier;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.dfsek.terra.minecraft.attribute.BiomeTags.PlatformTagSource;
|
||||
|
||||
|
||||
/**
|
||||
* Registered Terra biomes grouped by vanilla parent, and the platform tags of each.
|
||||
*/
|
||||
public final class TerraBiomeIndex {
|
||||
private final Map<Identifier, List<Identifier>> byParent = new LinkedHashMap<>();
|
||||
private final Map<Identifier, PlatformTagSource> tags = new LinkedHashMap<>();
|
||||
|
||||
/**
|
||||
* Warning for a config whose lowercased biome ID is already taken. The config reuses that biome.
|
||||
*/
|
||||
public static String sharedBiome(String pack, String config, Identifier terraId) {
|
||||
return "Pack \"" + pack + "\", config \"" + config + "\": reusing biome \"" + terraId
|
||||
+ "\"; another config's ID matches apart from case";
|
||||
}
|
||||
|
||||
public boolean contains(Identifier terraId) {
|
||||
return tags.containsKey(terraId);
|
||||
}
|
||||
|
||||
public void record(Identifier terraId, Identifier parent, PlatformTagSource source) {
|
||||
byParent.computeIfAbsent(parent, i -> new ArrayList<>()).add(terraId);
|
||||
tags.put(terraId, source);
|
||||
}
|
||||
|
||||
public void addAll(TerraBiomeIndex other) {
|
||||
other.byParent.forEach((parent, biomes) -> byParent.computeIfAbsent(parent, i -> new ArrayList<>()).addAll(biomes));
|
||||
tags.putAll(other.tags);
|
||||
}
|
||||
|
||||
public List<Identifier> children(Identifier parent) {
|
||||
return byParent.getOrDefault(parent, List.of());
|
||||
}
|
||||
|
||||
public Map<Identifier, List<Identifier>> byParent() {
|
||||
return Collections.unmodifiableMap(byParent);
|
||||
}
|
||||
|
||||
public Map<Identifier, PlatformTagSource> tags() {
|
||||
return Collections.unmodifiableMap(tags);
|
||||
}
|
||||
}
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* This file is part of Terra.
|
||||
*
|
||||
* Terra is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Terra is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Terra. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.dfsek.terra.minecraft.config;
|
||||
|
||||
import com.dfsek.tectonic.api.config.template.ConfigTemplate;
|
||||
import com.dfsek.tectonic.api.config.template.annotations.Default;
|
||||
import com.dfsek.tectonic.api.config.template.annotations.Value;
|
||||
|
||||
import com.dfsek.terra.api.properties.Properties;
|
||||
|
||||
|
||||
@SuppressWarnings("FieldMayBeFinal")
|
||||
public class MinecraftCompatibilityOptions implements ConfigTemplate, Properties {
|
||||
@Value("minecraft.use-vanilla-biomes")
|
||||
@Default
|
||||
private boolean vanillaBiomes = false;
|
||||
|
||||
@Value("minecraft.beard.enable")
|
||||
@Default
|
||||
private boolean beard = true;
|
||||
|
||||
@Value("minecraft.beard.threshold")
|
||||
@Default
|
||||
private double beardThreshold = 0.5;
|
||||
|
||||
@Value("minecraft.beard.air-threshold")
|
||||
@Default
|
||||
private double airThreshold = -0.5;
|
||||
|
||||
public boolean useVanillaBiomes() {
|
||||
return vanillaBiomes;
|
||||
}
|
||||
|
||||
public boolean isBeard() {
|
||||
return beard;
|
||||
}
|
||||
|
||||
public double getBeardThreshold() {
|
||||
return beardThreshold;
|
||||
}
|
||||
|
||||
public double getAirThreshold() {
|
||||
return airThreshold;
|
||||
}
|
||||
}
|
||||
+100
@@ -0,0 +1,100 @@
|
||||
package com.dfsek.terra.minecraft.generation;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.level.LevelHeightAccessor;
|
||||
import net.minecraft.world.level.NoiseColumn;
|
||||
import net.minecraft.world.level.StructureManager;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.chunk.ChunkAccess;
|
||||
import net.minecraft.world.level.levelgen.Beardifier;
|
||||
import net.minecraft.world.level.levelgen.densityfunction.SamplerContext;
|
||||
import net.minecraft.world.level.levelgen.structure.Structure;
|
||||
import net.minecraft.world.level.levelgen.structure.TerrainAdjustment;
|
||||
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
||||
import com.dfsek.terra.api.world.chunk.generation.ChunkGenerator;
|
||||
import com.dfsek.terra.api.world.info.WorldProperties;
|
||||
import com.dfsek.terra.minecraft.config.MinecraftCompatibilityOptions;
|
||||
|
||||
|
||||
/**
|
||||
* Structure beards, base height and base column, shared by the Fabric and Paper generators. {@code vanilla} converts a Terra
|
||||
* block state to Minecraft's.
|
||||
*/
|
||||
public final class TerraTerrain {
|
||||
private TerraTerrain() {
|
||||
}
|
||||
|
||||
public static void beard(ChunkAccess chunk, StructureManager structures, ChunkGenerator terra, BiomeProvider biomes,
|
||||
WorldProperties world, MinecraftCompatibilityOptions options,
|
||||
Function<com.dfsek.terra.api.block.state.BlockState, BlockState> vanilla) {
|
||||
if(!options.isBeard() || !adaptsTerrain(chunk)) return;
|
||||
Beardifier beardifier = Beardifier.forStructuresInChunk(structures, chunk.getPos());
|
||||
BlockPos.MutableBlockPos pos = new BlockPos.MutableBlockPos();
|
||||
beard(chunk.getPos().getMinBlockX(), chunk.getPos().getMinBlockZ(), chunk.getMinY(), chunk.getMaxY(),
|
||||
(x, y, z) -> beardifier.sampleValue(SamplerContext.EMPTY_UNCACHED, x, y, z), terra, biomes, world, options.getBeardThreshold(),
|
||||
options.getAirThreshold(), vanilla, (x, y, z, state) -> chunk.setBlockState(pos.set(x, y, z), state, 0));
|
||||
}
|
||||
|
||||
static void beard(int chunkX, int chunkZ, int minY, int maxY, Density density, ChunkGenerator terra, BiomeProvider biomes,
|
||||
WorldProperties world, double threshold, double airThreshold,
|
||||
Function<com.dfsek.terra.api.block.state.BlockState, BlockState> vanilla, BlockSink blocks) {
|
||||
BlockState air = Blocks.AIR.defaultBlockState();
|
||||
for(int x = 0; x < 16; x++) {
|
||||
for(int z = 0; z < 16; z++) {
|
||||
int worldX = chunkX + x;
|
||||
int worldZ = chunkZ + z;
|
||||
int depth = 0;
|
||||
for(int y = maxY; y >= minY; y--) {
|
||||
double value = density.sample(worldX, y, worldZ);
|
||||
if(value > threshold) {
|
||||
blocks.set(x, y, z, vanilla.apply(terra.getPalette(worldX, y, worldZ, world, biomes)
|
||||
.get(depth++, worldX, y, worldZ, world.getSeed())));
|
||||
} else if(value < airThreshold) {
|
||||
blocks.set(x, y, z, air);
|
||||
} else {
|
||||
depth = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static boolean adaptsTerrain(ChunkAccess chunk) {
|
||||
for(Structure structure : chunk.getAllReferences().keySet()) {
|
||||
if(structure.terrainAdaptation() != TerrainAdjustment.NONE) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static int baseHeight(ChunkGenerator terra, BiomeProvider biomes, WorldProperties world, LevelHeightAccessor height, int x,
|
||||
int z, Predicate<BlockState> opaque, Function<com.dfsek.terra.api.block.state.BlockState, BlockState> vanilla) {
|
||||
for(int y = height.getMaxY(); y >= height.getMinY(); y--) {
|
||||
if(opaque.test(vanilla.apply(terra.getBlock(world, x, y, z, biomes)))) return y + 1;
|
||||
}
|
||||
return height.getMinY();
|
||||
}
|
||||
|
||||
public static NoiseColumn baseColumn(ChunkGenerator terra, BiomeProvider biomes, WorldProperties world, LevelHeightAccessor height,
|
||||
int x, int z, Function<com.dfsek.terra.api.block.state.BlockState, BlockState> vanilla) {
|
||||
BlockState[] column = new BlockState[height.getHeight()];
|
||||
for(int i = 0; i < column.length; i++) {
|
||||
column[i] = vanilla.apply(terra.getBlock(world, x, height.getMinY() + i, z, biomes));
|
||||
}
|
||||
return new NoiseColumn(height.getMinY(), column);
|
||||
}
|
||||
|
||||
@FunctionalInterface
|
||||
interface Density {
|
||||
double sample(int x, int y, int z);
|
||||
}
|
||||
|
||||
@FunctionalInterface
|
||||
interface BlockSink {
|
||||
void set(int x, int y, int z, BlockState state);
|
||||
}
|
||||
}
|
||||
+12
-6
@@ -49,10 +49,14 @@ class BiomeTagsTest {
|
||||
.map(h -> h);
|
||||
}
|
||||
|
||||
private void add(Map<Identifier, List<Identifier>> byParent, String... tags) {
|
||||
private PlatformTagSource source(String... tags) {
|
||||
Set<RegistryKey> keys = new LinkedHashSet<>();
|
||||
for(String t : tags) keys.add(RegistryKey.parse(t));
|
||||
BiomeTags.addTerraBiomes(collect, this::lookup, byParent, Map.of(TERRA_ID, new PlatformTagSource(report, "BIOME", keys)));
|
||||
return new PlatformTagSource(report, "BIOME", keys);
|
||||
}
|
||||
|
||||
private void add(String... tags) {
|
||||
BiomeTags.addPlatformTags(collect, this::lookup, Map.of(TERRA_ID, source(tags)));
|
||||
}
|
||||
|
||||
private static void bindTags(Holder<Biome> holder, TagKey<Biome> tag) throws ReflectiveOperationException {
|
||||
@@ -66,7 +70,7 @@ class BiomeTagsTest {
|
||||
Holder<Biome> forest = registry.get(Biomes.FOREST).orElseThrow();
|
||||
collect.put(IS_FOREST, new ArrayList<>(List.of(forest)));
|
||||
|
||||
add(Map.of(), "mypack:has_snow", "minecraft:is_forest");
|
||||
add("mypack:has_snow", "minecraft:is_forest");
|
||||
|
||||
assertEquals(List.of(terra), collect.get(HAS_SNOW));
|
||||
assertEquals(List.of(forest, terra), collect.get(IS_FOREST));
|
||||
@@ -79,7 +83,9 @@ class BiomeTagsTest {
|
||||
bindTags(forest, IS_FOREST);
|
||||
Identifier forestId = Biomes.FOREST.identifier();
|
||||
|
||||
add(Map.of(forestId, List.of(TERRA_ID)));
|
||||
TerraBiomeIndex biomes = new TerraBiomeIndex();
|
||||
biomes.record(TERRA_ID, forestId, source());
|
||||
BiomeTags.addTerraBiomes(collect, this::lookup, biomes);
|
||||
|
||||
assertEquals(List.of(terra), collect.get(IS_FOREST));
|
||||
assertEquals(List.of(), warnings);
|
||||
@@ -87,7 +93,7 @@ class BiomeTagsTest {
|
||||
|
||||
@Test
|
||||
void upperCaseTagIsIgnored() {
|
||||
add(Map.of(), "mypack:Has_Snow");
|
||||
add("mypack:Has_Snow");
|
||||
|
||||
assertTrue(collect.isEmpty(), collect.toString());
|
||||
assertEquals(1, warnings.size(), warnings.toString());
|
||||
@@ -97,7 +103,7 @@ class BiomeTagsTest {
|
||||
|
||||
@Test
|
||||
void missingMinecraftTagWarnsAndIsCreated() {
|
||||
add(Map.of(), "minecraft:is_forrest");
|
||||
add("minecraft:is_forrest");
|
||||
|
||||
assertEquals(List.of("Pack \"test\", config \"BIOME\": tag \"minecraft:is_forrest\" created: no such tag in the minecraft namespace"),
|
||||
warnings);
|
||||
|
||||
+120
@@ -0,0 +1,120 @@
|
||||
package com.dfsek.terra.minecraft.generation;
|
||||
|
||||
import net.minecraft.world.level.LevelHeightAccessor;
|
||||
import net.minecraft.world.level.NoiseColumn;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.lang.reflect.Proxy;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.IntFunction;
|
||||
|
||||
import com.dfsek.terra.api.world.chunk.generation.ChunkGenerator;
|
||||
import com.dfsek.terra.api.world.chunk.generation.util.Palette;
|
||||
import com.dfsek.terra.api.world.info.WorldProperties;
|
||||
import com.dfsek.terra.minecraft.attribute.MinecraftTestSupport;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertSame;
|
||||
|
||||
|
||||
class TerraTerrainTest {
|
||||
static {
|
||||
MinecraftTestSupport.REGISTRIES.hashCode();
|
||||
}
|
||||
|
||||
private static final com.dfsek.terra.api.block.state.BlockState STONE = terra("stone");
|
||||
private static final com.dfsek.terra.api.block.state.BlockState AIR = terra("air");
|
||||
private static final com.dfsek.terra.api.block.state.BlockState DIRT = terra("dirt");
|
||||
private static final Map<com.dfsek.terra.api.block.state.BlockState, BlockState> VANILLA = Map.of(
|
||||
STONE, Blocks.STONE.defaultBlockState(), AIR, Blocks.AIR.defaultBlockState(), DIRT, Blocks.DIRT.defaultBlockState());
|
||||
private static final Function<com.dfsek.terra.api.block.state.BlockState, BlockState> TO_VANILLA = VANILLA::get;
|
||||
private static final LevelHeightAccessor HEIGHT = LevelHeightAccessor.create(-4, 8);
|
||||
|
||||
@Test
|
||||
void baseColumnCoversTheWholeHeightBottomUp() {
|
||||
NoiseColumn column = TerraTerrain.baseColumn(generator(y -> y < 0 ? STONE : AIR, null), null, null, HEIGHT, 0, 0, TO_VANILLA);
|
||||
|
||||
for(int y = -4; y < 4; y++) {
|
||||
assertSame(y < 0 ? Blocks.STONE.defaultBlockState() : Blocks.AIR.defaultBlockState(), column.getBlock(y), "y " + y);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void baseHeightIsAboveTheTopOpaqueBlock() {
|
||||
int height = TerraTerrain.baseHeight(generator(y -> y <= 1 ? STONE : AIR, null), null, null, HEIGHT, 0, 0,
|
||||
state -> !state.isAir(), TO_VANILLA);
|
||||
|
||||
assertEquals(2, height);
|
||||
}
|
||||
|
||||
@Test
|
||||
void baseHeightCountsTheTopBlock() {
|
||||
int height = TerraTerrain.baseHeight(generator(y -> y == 3 ? STONE : AIR, null), null, null, HEIGHT, 0, 0,
|
||||
state -> !state.isAir(), TO_VANILLA);
|
||||
|
||||
assertEquals(4, height);
|
||||
}
|
||||
|
||||
@Test
|
||||
void baseHeightOfAnEmptyColumnIsTheBottom() {
|
||||
assertEquals(-4, TerraTerrain.baseHeight(generator(y -> AIR, null), null, null, HEIGHT, 0, 0, state -> !state.isAir(), TO_VANILLA));
|
||||
}
|
||||
|
||||
@Test
|
||||
void beardFillsDenseBlocksWithPaletteLayersAndClearsSparseOnes() {
|
||||
List<Integer> layers = new ArrayList<>();
|
||||
Map<Integer, BlockState> placed = new HashMap<>();
|
||||
// Every column gets the same density: dense at 2, 1 and -2, neutral at 0, sparse at -1.
|
||||
TerraTerrain.beard(32, 48, -2, 2, (x, y, z) -> switch(y) {
|
||||
case 2, 1, -2 -> 1;
|
||||
case -1 -> -1;
|
||||
default -> 0;
|
||||
}, generator(y -> AIR, layer -> {
|
||||
layers.add(layer);
|
||||
return layer == 0 ? DIRT : STONE;
|
||||
}), null, properties(), 0.5, -0.5, TO_VANILLA,
|
||||
(x, y, z, state) -> {
|
||||
if(x == 0 && z == 0) placed.put(y, state);
|
||||
});
|
||||
|
||||
assertEquals(Map.of(2, Blocks.DIRT.defaultBlockState(), 1, Blocks.STONE.defaultBlockState(), -1, Blocks.AIR.defaultBlockState(),
|
||||
-2, Blocks.DIRT.defaultBlockState()), placed);
|
||||
assertEquals(List.of(0, 1, 0), layers.subList(0, 3));
|
||||
}
|
||||
|
||||
private static ChunkGenerator generator(IntFunction<com.dfsek.terra.api.block.state.BlockState> byY,
|
||||
IntFunction<com.dfsek.terra.api.block.state.BlockState> byLayer) {
|
||||
Palette palette = (layer, x, y, z, seed) -> byLayer.apply(layer);
|
||||
return (ChunkGenerator) Proxy.newProxyInstance(ChunkGenerator.class.getClassLoader(), new Class<?>[]{ ChunkGenerator.class },
|
||||
(proxy, method, args) -> switch(method.getName()) {
|
||||
case "getBlock" -> byY.apply((int) args[2]);
|
||||
case "getPalette" -> palette;
|
||||
default -> throw new UnsupportedOperationException(method.getName());
|
||||
});
|
||||
}
|
||||
|
||||
private static WorldProperties properties() {
|
||||
return (WorldProperties) Proxy.newProxyInstance(WorldProperties.class.getClassLoader(), new Class<?>[]{ WorldProperties.class },
|
||||
(proxy, method, args) -> switch(method.getName()) {
|
||||
case "getSeed" -> 0L;
|
||||
default -> throw new UnsupportedOperationException(method.getName());
|
||||
});
|
||||
}
|
||||
|
||||
private static com.dfsek.terra.api.block.state.BlockState terra(String name) {
|
||||
return (com.dfsek.terra.api.block.state.BlockState) Proxy.newProxyInstance(
|
||||
com.dfsek.terra.api.block.state.BlockState.class.getClassLoader(), new Class<?>[]{ com.dfsek.terra.api.block.state.BlockState.class },
|
||||
(proxy, method, args) -> switch(method.getName()) {
|
||||
case "hashCode" -> System.identityHashCode(proxy);
|
||||
case "equals" -> proxy == args[0];
|
||||
case "toString" -> name;
|
||||
default -> throw new UnsupportedOperationException(method.getName());
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user