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 {
minecraft "com.mojang:minecraft:1.17"
mappings "net.fabricmc:yarn:1.17+build.13:v2"
minecraft "com.mojang:minecraft:1.17.1"
mappings "net.fabricmc:yarn:1.17.1+build.38:v2"
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("org.jgrapht", "jgrapht-core", "1.1.0")
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(
childItem.getOriginalItem(),
stack.getCount());
originalItemStack.setTag(stack.getTag());
originalItemStack.setNbt(stack.getNbt());
matrices.push();
childItem.transform(matrices);

View file

@ -28,7 +28,7 @@ public class WorldeditHelper {
static int load(ServerCommandSource source, PocketTemplate template) throws CommandSyntaxException {
ServerPlayerEntity player = source.getPlayer();
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 = () -> {
NbtCompound nbt = Schematic.toNbt(template.getSchematic());
ByteArrayOutputStream stream = new ByteArrayOutputStream();

View file

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

View file

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

View file

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

View file

@ -58,8 +58,8 @@ public class RiftKeyItem extends Item {
}
@Override
public boolean shouldSyncTagToClient() {
return super.shouldSyncTagToClient();
public boolean isNbtSynced() {
return super.isNbtSynced();
}
@Override
@ -69,13 +69,13 @@ public class RiftKeyItem extends Item {
@Override
public void onCraft(ItemStack stack, World world, PlayerEntity player) {
stack.setTag(this.getDefaultStack().getTag());
stack.setNbt(this.getDefaultStack().getNbt());
}
@Override
public ItemStack 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;
}
@ -117,25 +117,25 @@ public class RiftKeyItem extends Item {
public static boolean tryRemove(ItemStack stack, UUID 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) {
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) {
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) {
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) {
return stack.getOrCreateTag()
return stack.getOrCreateNbt()
.getList("Ids", NbtType.INT_ARRAY)
.stream()
.map(NbtIntArray.class::cast)

View file

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

View file

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

View file

@ -18,7 +18,7 @@ public class EternalFluidLakeDecorator extends Decorator<ChanceDecoratorConfig>
@Override
public Stream<BlockPos> getPositions(DecoratorContext context, Random random, ChanceDecoratorConfig config, BlockPos pos) {
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();