This commit is contained in:
CreepyCre 2021-08-15 13:26:01 +02:00
parent 8c08f74d4f
commit 0c867f7d94
10 changed files with 32 additions and 32 deletions

View file

@ -117,10 +117,10 @@ minecraft {
} }
dependencies { dependencies {
minecraft "com.mojang:minecraft:1.17" minecraft "com.mojang:minecraft:1.17.1"
mappings "net.fabricmc:yarn:1.17+build.13:v2" mappings "net.fabricmc:yarn:1.17.1+build.38:v2"
modImplementation "net.fabricmc:fabric-loader:0.11.6" modImplementation "net.fabricmc:fabric-loader:0.11.6"
modImplementation "net.fabricmc.fabric-api:fabric-api:0.36.0+1.17" modImplementation "net.fabricmc.fabric-api:fabric-api:0.37.2+1.17"
includeCompile("com.flowpowered", "flow-math", "1.0.3") includeCompile("com.flowpowered", "flow-math", "1.0.3")
includeCompile("org.jgrapht", "jgrapht-core", "1.1.0") includeCompile("org.jgrapht", "jgrapht-core", "1.1.0")
includeCompile("com.github.DimensionalDevelopment", "poly2tri.java", "0.1.1") includeCompile("com.github.DimensionalDevelopment", "poly2tri.java", "0.1.1")

View file

@ -43,7 +43,7 @@ public class UnderlaidChildItemRenderer implements BuiltinItemRendererRegistry.D
ItemStack originalItemStack = new ItemStack( ItemStack originalItemStack = new ItemStack(
childItem.getOriginalItem(), childItem.getOriginalItem(),
stack.getCount()); stack.getCount());
originalItemStack.setTag(stack.getTag()); originalItemStack.setNbt(stack.getNbt());
matrices.push(); matrices.push();
childItem.transform(matrices); childItem.transform(matrices);

View file

@ -28,7 +28,7 @@ public class WorldeditHelper {
static int load(ServerCommandSource source, PocketTemplate template) throws CommandSyntaxException { static int load(ServerCommandSource source, PocketTemplate template) throws CommandSyntaxException {
ServerPlayerEntity player = source.getPlayer(); ServerPlayerEntity player = source.getPlayer();
boolean async = DimensionalDoorsInitializer.getConfig().getPocketsConfig().asyncWorldEditPocketLoading; boolean async = DimensionalDoorsInitializer.getConfig().getPocketsConfig().asyncWorldEditPocketLoading;
Consumer<Runnable> taskAcceptor = async ? r -> source.getMinecraftServer().execute(r) : Runnable::run; Consumer<Runnable> taskAcceptor = async ? r -> source.getServer().execute(r) : Runnable::run;
Runnable task = () -> { Runnable task = () -> {
NbtCompound nbt = Schematic.toNbt(template.getSchematic()); NbtCompound nbt = Schematic.toNbt(template.getSchematic());
ByteArrayOutputStream stream = new ByteArrayOutputStream(); ByteArrayOutputStream stream = new ByteArrayOutputStream();

View file

@ -18,7 +18,7 @@ public class PocketSpawnPointSetCondition extends AbstractCriterion<PocketSpawnP
} }
public void trigger(ServerPlayerEntity player) { public void trigger(ServerPlayerEntity player) {
this.test(player, t -> true); this.trigger(player, t -> true);
} }
@Override @Override

View file

@ -18,7 +18,7 @@ public class RiftTrackedCriterion extends AbstractCriterion<RiftTrackedCriterion
} }
public void trigger(ServerPlayerEntity player) { public void trigger(ServerPlayerEntity player) {
this.test(player, t -> true); this.trigger(player, t -> true);
} }
@Override @Override

View file

@ -25,7 +25,7 @@ public class TagBlockBreakCriteria extends AbstractCriterion<TagBlockBreakCriter
} }
public void trigger(ServerPlayerEntity player, Block block) { public void trigger(ServerPlayerEntity player, Block block) {
this.test(player, c -> c.getBlockTag().contains(block)); this.trigger(player, c -> c.getBlockTag().contains(block));
} }
@Override @Override

View file

@ -58,8 +58,8 @@ public class RiftKeyItem extends Item {
} }
@Override @Override
public boolean shouldSyncTagToClient() { public boolean isNbtSynced() {
return super.shouldSyncTagToClient(); return super.isNbtSynced();
} }
@Override @Override
@ -69,13 +69,13 @@ public class RiftKeyItem extends Item {
@Override @Override
public void onCraft(ItemStack stack, World world, PlayerEntity player) { public void onCraft(ItemStack stack, World world, PlayerEntity player) {
stack.setTag(this.getDefaultStack().getTag()); stack.setNbt(this.getDefaultStack().getNbt());
} }
@Override @Override
public ItemStack getDefaultStack() { public ItemStack getDefaultStack() {
ItemStack stack = super.getDefaultStack(); ItemStack stack = super.getDefaultStack();
stack.putSubTag("Ids", ListTagAccessor.createListTag(new ArrayList<>(), (byte) NbtType.INT_ARRAY)); stack.setSubNbt("Ids", ListTagAccessor.createListTag(new ArrayList<>(), (byte) NbtType.INT_ARRAY));
return stack; return stack;
} }
@ -117,25 +117,25 @@ public class RiftKeyItem extends Item {
public static boolean tryRemove(ItemStack stack, UUID id) { public static boolean tryRemove(ItemStack stack, UUID id) {
NbtIntArray arrayTag = new NbtIntArray(DynamicSerializableUuid.toIntArray(id)); NbtIntArray arrayTag = new NbtIntArray(DynamicSerializableUuid.toIntArray(id));
return stack.getTag().getList("Ids", NbtType.INT_ARRAY).remove(arrayTag); return stack.getNbt().getList("Ids", NbtType.INT_ARRAY).remove(arrayTag);
} }
public static void add(ItemStack stack, UUID id) { public static void add(ItemStack stack, UUID id) {
if (!has(stack, id)) { if (!has(stack, id)) {
stack.getOrCreateTag().getList("Ids", NbtType.INT_ARRAY).add(new NbtIntArray(DynamicSerializableUuid.toIntArray(id))); stack.getOrCreateNbt().getList("Ids", NbtType.INT_ARRAY).add(new NbtIntArray(DynamicSerializableUuid.toIntArray(id)));
} }
} }
public static boolean has(ItemStack stack, UUID id) { public static boolean has(ItemStack stack, UUID id) {
return stack.getOrCreateTag().getList("Ids", NbtType.INT_ARRAY).contains(new NbtIntArray(DynamicSerializableUuid.toIntArray(id))); return stack.getOrCreateNbt().getList("Ids", NbtType.INT_ARRAY).contains(new NbtIntArray(DynamicSerializableUuid.toIntArray(id)));
} }
public static boolean isEmpty(ItemStack stack) { public static boolean isEmpty(ItemStack stack) {
return stack.getOrCreateTag().getList("Ids", NbtType.INT_ARRAY).isEmpty(); return stack.getOrCreateNbt().getList("Ids", NbtType.INT_ARRAY).isEmpty();
} }
public static List<UUID> getIds(ItemStack stack) { public static List<UUID> getIds(ItemStack stack) {
return stack.getOrCreateTag() return stack.getOrCreateNbt()
.getList("Ids", NbtType.INT_ARRAY) .getList("Ids", NbtType.INT_ARRAY)
.stream() .stream()
.map(NbtIntArray.class::cast) .map(NbtIntArray.class::cast)

View file

@ -45,7 +45,7 @@ public class RiftSignatureItem extends Item {
@Override @Override
public boolean hasGlint(ItemStack stack) { public boolean hasGlint(ItemStack stack) {
return stack.getTag() != null && stack.getTag().contains("destination"); return stack.getNbt() != null && stack.getNbt().contains("destination");
} }
@Override @Override
@ -116,19 +116,19 @@ public class RiftSignatureItem extends Item {
} }
public static void setSource(ItemStack itemStack, RotatedLocation destination) { public static void setSource(ItemStack itemStack, RotatedLocation destination) {
if (!itemStack.hasTag()) itemStack.setTag(new NbtCompound()); if (!itemStack.hasNbt()) itemStack.setNbt(new NbtCompound());
itemStack.getTag().put("destination", RotatedLocation.serialize(destination)); itemStack.getNbt().put("destination", RotatedLocation.serialize(destination));
} }
public static void clearSource(ItemStack itemStack) { public static void clearSource(ItemStack itemStack) {
if (itemStack.hasTag()) { if (itemStack.hasNbt()) {
itemStack.getTag().remove("destination"); itemStack.getNbt().remove("destination");
} }
} }
public static RotatedLocation getSource(ItemStack itemStack) { public static RotatedLocation getSource(ItemStack itemStack) {
if (itemStack.hasTag() && itemStack.getTag().contains("destination")) { if (itemStack.hasNbt() && itemStack.getNbt().contains("destination")) {
return RotatedLocation.deserialize(itemStack.getTag().getCompound("destination")); return RotatedLocation.deserialize(itemStack.getNbt().getCompound("destination"));
} else { } else {
return null; return null;
} }

View file

@ -39,7 +39,7 @@ public class StabilizedRiftSignatureItem extends Item { // TODO: common supercla
@Override @Override
public boolean hasGlint(ItemStack stack) { public boolean hasGlint(ItemStack stack) {
return stack.getTag() != null && stack.getTag().contains("destination"); return stack.getNbt() != null && stack.getNbt().contains("destination");
} }
@Override @Override
@ -101,19 +101,19 @@ public class StabilizedRiftSignatureItem extends Item { // TODO: common supercla
} }
public static void setSource(ItemStack itemStack, RotatedLocation destination) { public static void setSource(ItemStack itemStack, RotatedLocation destination) {
if (!itemStack.hasTag()) itemStack.setTag(new NbtCompound()); if (!itemStack.hasNbt()) itemStack.setNbt(new NbtCompound());
itemStack.getTag().put("destination", RotatedLocation.serialize(destination)); itemStack.getNbt().put("destination", RotatedLocation.serialize(destination));
} }
public static void clearSource(ItemStack itemStack) { public static void clearSource(ItemStack itemStack) {
if (itemStack.hasTag()) { if (itemStack.hasNbt()) {
itemStack.getTag().remove("destination"); itemStack.getNbt().remove("destination");
} }
} }
public static RotatedLocation getTarget(ItemStack itemStack) { public static RotatedLocation getTarget(ItemStack itemStack) {
if (itemStack.hasTag() && itemStack.getTag().contains("destination")) { if (itemStack.hasNbt() && itemStack.getNbt().contains("destination")) {
return RotatedLocation.deserialize(itemStack.getTag().getCompound("destination")); return RotatedLocation.deserialize(itemStack.getNbt().getCompound("destination"));
} else { } else {
return null; return null;
} }

View file

@ -18,7 +18,7 @@ public class EternalFluidLakeDecorator extends Decorator<ChanceDecoratorConfig>
@Override @Override
public Stream<BlockPos> getPositions(DecoratorContext context, Random random, ChanceDecoratorConfig config, BlockPos pos) { public Stream<BlockPos> getPositions(DecoratorContext context, Random random, ChanceDecoratorConfig config, BlockPos pos) {
if (random.nextInt(config.chance) == 0) { if (random.nextInt(config.chance) == 0) {
return Stream.of(new BlockPos(random.nextInt(16) + pos.getX(), random.nextInt(context.getMaxY()), random.nextInt(16) + pos.getZ())); return Stream.of(new BlockPos(random.nextInt(16) + pos.getX(), random.nextInt(context.getHeight()), random.nextInt(16) + pos.getZ()));
} }
return Stream.empty(); return Stream.empty();