Inspired by 2020's April Fools' 20w14infinite Snapshot, this mod brings endless randomly generated dimensions into Minecraft.

messy 1.21.8 work

+230 -183
+2 -2
common/src/main/java/net/lerariemann/infinity/access/Timebombable.java
··· 34 34 } 35 35 else if (i > 200) { 36 36 if (i%4 == 0) { 37 - Registry<DamageType> r = player.getServerWorld().getServer().getRegistryManager().getOrThrow(RegistryKeys.DAMAGE_TYPE); 37 + Registry<DamageType> r = player.getServer().getRegistryManager().getOrThrow(RegistryKeys.DAMAGE_TYPE); 38 38 RegistryEntry<DamageType> entry = r.getEntry(r.get(InfinityMethods.getId("world_ceased"))); 39 - player.damage(player.getServerWorld(), new DamageSource(entry), i > 400 ? 2.0f : 1.0f); 39 + player.damage(player.getWorld(), new DamageSource(entry), i > 400 ? 2.0f : 1.0f); 40 40 } 41 41 } 42 42 }
+16 -12
common/src/main/java/net/lerariemann/infinity/block/entity/BiomeBottleBlockEntity.java
··· 16 16 import net.minecraft.registry.entry.RegistryEntry; 17 17 import net.minecraft.screen.PropertyDelegate; 18 18 import net.minecraft.server.world.ServerWorld; 19 + import net.minecraft.storage.ReadView; 20 + import net.minecraft.storage.WriteView; 19 21 import net.minecraft.util.Identifier; 20 22 import net.minecraft.util.math.BlockPos; 21 23 import net.minecraft.world.World; ··· 61 63 this.biome = i; 62 64 } 63 65 64 - public void writeNbt(NbtCompound tag, RegistryWrapper.WrapperLookup registryLookup) { 65 - super.writeNbt(tag, registryLookup); 66 - tag.putString("Biome", biome.toString()); 67 - tag.putInt("Color", color); 68 - tag.putInt("Charge", charge); 69 - if (from_charge > 0) tag.putInt("from_charge", from_charge); 66 + @Override 67 + protected void writeData(WriteView view) { 68 + super.writeData(view); 69 + view.putString("Biome", biome.toString()); 70 + view.putInt("Color", color); 71 + view.putInt("Charge", charge); 72 + if (from_charge > 0) view.putInt("from_charge", from_charge); 70 73 } 71 74 72 - public void readNbt(NbtCompound tag, RegistryWrapper.WrapperLookup registryLookup) { 73 - super.readNbt(tag, registryLookup); 74 - this.charge = NbtUtils.getInt(tag, "Charge"); 75 - this.biome = Identifier.of(NbtUtils.getString(tag, "Biome")); 76 - this.color = NbtUtils.getInt(tag, "Color"); 77 - this.from_charge = NbtUtils.getInt(tag, "from_charge", 0); 75 + @Override 76 + public void readData(ReadView view) { 77 + super.readData(view); 78 + this.charge = NbtUtils.getInt(view, "Charge"); 79 + this.biome = Identifier.of(NbtUtils.getString(view, "Biome")); 80 + this.color = NbtUtils.getInt(view, "Color"); 81 + this.from_charge = NbtUtils.getInt(view, "from_charge", 0); 78 82 } 79 83 80 84 @Override
+18 -16
common/src/main/java/net/lerariemann/infinity/block/entity/ChromaticBlockEntity.java
··· 22 22 import net.minecraft.sound.SoundCategory; 23 23 import net.minecraft.sound.SoundEvent; 24 24 import net.minecraft.sound.SoundEvents; 25 + import net.minecraft.storage.ReadView; 26 + import net.minecraft.storage.WriteView; 25 27 import net.minecraft.util.math.BlockPos; 26 28 import net.minecraft.world.World; 27 29 import org.jetbrains.annotations.Nullable; ··· 159 161 } 160 162 161 163 @Override 162 - public void readNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup registryLookup) { 163 - super.readNbt(nbt, registryLookup); 164 - if (nbt.get("color").getType() == NbtElement.INT_TYPE) 165 - setColor(nbt.getInt("color").get()); 166 - else if (nbt.get("color").getType() == NbtElement.COMPOUND_TYPE) { 167 - NbtCompound color = NbtUtils.getCompound(nbt, "color"); 168 - hue = NbtUtils.getShort(color, "h"); 169 - saturation = NbtUtils.getShort(color, "s"); 170 - brightness = NbtUtils.getShort(color, "b"); 164 + public void readData(ReadView nbt) { 165 + super.readData(nbt); 166 + if (nbt.contains("color") && nbt.getInt("color", 0) != 0) { 167 + var color = nbt.getOptionalInt("color"); 168 + setColor(color.get()); 169 + } 170 + else if (nbt.getOptionalReadView("color").isPresent()) { 171 + ReadView color = nbt.getOptionalReadView("color").get(); 172 + hue = (short) color.getShort("h", (short)0); 173 + saturation = (short) color.getShort("s", (short)0); 174 + brightness = (short) color.getShort("b", (short)0); 171 175 updateColor(); 172 176 } 173 177 } 174 178 @Override 175 - protected void writeNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup registryLookup) { 176 - super.writeNbt(nbt, registryLookup); 177 - NbtCompound color = new NbtCompound(); 178 - color.putShort("h", hue); 179 - color.putShort("s", saturation); 180 - color.putShort("b", brightness); 181 - nbt.put("color", color); 179 + protected void writeData(WriteView nbt) { 180 + super.writeData(nbt); 181 + nbt.putShort("h", hue); 182 + nbt.putShort("s", saturation); 183 + nbt.putShort("b", brightness); 182 184 } 183 185 184 186 public int getTint() {
+6 -4
common/src/main/java/net/lerariemann/infinity/block/entity/CosmicAltarBlockEntity.java
··· 6 6 import net.minecraft.nbt.NbtCompound; 7 7 import net.minecraft.network.packet.s2c.play.BlockEntityUpdateS2CPacket; 8 8 import net.minecraft.registry.RegistryWrapper; 9 + import net.minecraft.storage.ReadView; 10 + import net.minecraft.storage.WriteView; 9 11 import net.minecraft.util.math.BlockPos; 10 12 import net.minecraft.world.World; 11 13 import org.jetbrains.annotations.Nullable; ··· 26 28 } 27 29 28 30 @Override 29 - public void readNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup registryLookup) { 30 - super.readNbt(nbt, registryLookup); 31 + protected void readData(ReadView view) { 32 + super.readData(view); 31 33 } 32 34 33 35 @Override 34 - protected void writeNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup registryLookup) { 35 - super.writeNbt(nbt, registryLookup); 36 + protected void writeData(WriteView view) { 37 + super.writeData(view); 36 38 } 37 39 38 40 @Nullable
+24 -24
common/src/main/java/net/lerariemann/infinity/block/entity/InfinityPortalBlockEntity.java
··· 15 15 import net.minecraft.screen.PropertyDelegate; 16 16 import net.minecraft.server.MinecraftServer; 17 17 import net.minecraft.server.world.ServerWorld; 18 + import net.minecraft.storage.ReadView; 19 + import net.minecraft.storage.WriteView; 18 20 import net.minecraft.util.Identifier; 19 21 import net.minecraft.util.math.BlockPos; 20 22 import org.jetbrains.annotations.Nullable; ··· 138 140 } 139 141 140 142 141 - public void writeNbt(NbtCompound tag, RegistryWrapper.WrapperLookup registryLookup) { 142 - super.writeNbt(tag, registryLookup); 143 + @Override 144 + protected void writeData(WriteView tag) { 145 + super.writeData(tag); 143 146 tag.putInt("Color", this.portalColor); 144 147 tag.putString("Dimension", this.dimension.toString()); 145 148 tag.putBoolean("Open", this.isOpen); 146 149 if (otherSidePos != null) { 147 - NbtCompound pos = new NbtCompound(); 148 - pos.putInt("x", otherSidePos.getX()); 149 - pos.putInt("y", otherSidePos.getY()); 150 - pos.putInt("z", otherSidePos.getZ()); 151 - tag.put("other_side", pos); 150 + tag.put("other_side", BlockPos.CODEC, otherSidePos); 152 151 } 153 152 } 154 153 155 - public void readNbt(NbtCompound tag, RegistryWrapper.WrapperLookup registryLookup) { 156 - super.readNbt(tag, registryLookup); 157 - if (tag.get("Dimension").getType() == NbtElement.INT_TYPE) { //conversion from legacy formats 158 - this.portalColor = NbtUtils.getInt(tag, "Dimension") & 0xFFFFFF; 159 - if (tag.contains("DimensionName")) { 160 - this.dimension = Identifier.of(NbtUtils.getString(tag, "DimensionName")); 161 - } 162 - else this.dimension = InfinityMethods.getDimId(this.portalColor); 163 - } 164 - else if (tag.get("Dimension").getType() == NbtElement.STRING_TYPE) { //new better format 165 - this.dimension = Identifier.of(NbtUtils.getString(tag, "Dimension")); 154 + @Override 155 + protected void readData(ReadView view) { 156 + super.readData(view); 157 + // if (view.get("Dimension").getType() == NbtElement.INT_TYPE) { //conversion from legacy formats 158 + // this.portalColor = NbtUtils.getInt(tag, "Dimension") & 0xFFFFFF; 159 + // if (tag.contains("DimensionName")) { 160 + // this.dimension = Identifier.of(NbtUtils.getString(tag, "DimensionName")); 161 + // } 162 + // else this.dimension = InfinityMethods.getDimId(this.portalColor); 163 + // } 164 + // else 165 + if (view.contains("Dimension")) { //new better format 166 + this.dimension = Identifier.of(NbtUtils.getString(view, "Dimension")); 166 167 if (world != null && world.getServer() != null) 167 - this.portalColor = NbtUtils.getInt(tag, "Color", PortalColorApplier.of(dimension, world.getServer()).apply(pos) & 0xFFFFFF); 168 + this.portalColor = NbtUtils.getInt(view, "Color", PortalColorApplier.of(dimension, world.getServer()).apply(pos) & 0xFFFFFF); 168 169 else 169 - this.portalColor = NbtUtils.getInt(tag, "Color", PortalColorApplier.of(dimension, new NbtCompound()).apply(pos) & 0xFFFFFF); 170 + this.portalColor = NbtUtils.getInt(view, "Color", PortalColorApplier.of(dimension, new NbtCompound()).apply(pos) & 0xFFFFFF); 170 171 } 171 172 else { 172 173 setDimension(InfinityMethods.getRandomSeed(new Random())); //random by default 173 174 } 174 - this.isOpen = NbtUtils.getBoolean(tag, "Open", false); 175 - if (tag.contains("other_side")) { 176 - NbtCompound pos = NbtUtils.getCompound(tag,"other_side"); 177 - otherSidePos = new BlockPos(NbtUtils.getInt(pos, "x"), NbtUtils.getInt(pos, "y"), NbtUtils.getInt(pos, "z")); 175 + this.isOpen = NbtUtils.getBoolean(view, "Open", false); 176 + if (view.contains("other_side")) { 177 + otherSidePos = view.read("other_side", BlockPos.CODEC).get(); 178 178 } 179 179 } 180 180
+2 -2
common/src/main/java/net/lerariemann/infinity/compat/eiv/iridescence_crafting/IridescenceCraftingServerRecipe.java
··· 42 42 @Override 43 43 public void writeToTag(NbtCompound tag) { 44 44 tag.put("ingredient", EivTagUtil.writeIngredient(this.input)); 45 - tag.put("result", EivTagUtil.encodeItemStack(this.output)); 45 + tag.put("result", EivTagUtil.encodeItemStackOnServer(this.output)); 46 46 tag.put("lore", NbtString.of(this.lore)); 47 47 } 48 48 49 49 @Override 50 50 public void loadFromTag(NbtCompound tag) { 51 51 this.input = EivTagUtil.readIngredient(NbtUtils.getCompound(tag, "ingredient")); 52 - this.output = EivTagUtil.decodeItemStack(NbtUtils.getCompound(tag, "result")); 52 + this.output = EivTagUtil.decodeItemStackOnClient(NbtUtils.getCompound(tag, "result")); 53 53 this.lore = NbtUtils.getString(tag,"lore"); 54 54 } 55 55
+2 -2
common/src/main/java/net/lerariemann/infinity/compat/eiv/portal_crafting/PortalCraftingServerRecipe.java
··· 44 44 @Override 45 45 public void writeToTag(NbtCompound tag) { 46 46 tag.put("ingredient", EivTagUtil.writeIngredient(this.input)); 47 - tag.put("result", EivTagUtil.encodeItemStack(this.output)); 47 + tag.put("result", EivTagUtil.encodeItemStackOnServer(this.output)); 48 48 tag.put("lore", NbtString.of(this.lore)); 49 49 } 50 50 51 51 @Override 52 52 public void loadFromTag(NbtCompound tag) { 53 53 this.input = EivTagUtil.readIngredient(NbtUtils.getCompound(tag, "ingredient")); 54 - this.output = EivTagUtil.decodeItemStack(NbtUtils.getCompound(tag, "result")); 54 + this.output = EivTagUtil.decodeItemStackOnClient(NbtUtils.getCompound(tag, "result")); 55 55 this.lore = NbtUtils.getString(tag, "lore"); 56 56 } 57 57
+1 -1
common/src/main/java/net/lerariemann/infinity/entity/client/AntModel.java
··· 79 79 80 80 81 81 82 - @Override 82 + // @Override 83 83 public Optional<ModelPart> getPart(String part) { 84 84 return Optional.of(body); 85 85 }
+6 -6
common/src/main/java/net/lerariemann/infinity/entity/client/DimensionalSlimeCoreRenderer.java
··· 2 2 3 3 import net.fabricmc.fabric.api.renderer.v1.render.FabricBlockModelRenderer; 4 4 import net.lerariemann.infinity.entity.client.state.ChaosSlimeRenderState; 5 - import net.lerariemann.infinity.entity.custom.ChaosSlime; 6 5 import net.minecraft.block.BlockState; 7 - import net.minecraft.client.MinecraftClient; 8 - import net.minecraft.client.render.RenderLayers; 6 + import net.minecraft.client.render.RenderLayer; 7 + import net.minecraft.client.render.VertexConsumer; 9 8 import net.minecraft.client.render.VertexConsumerProvider; 10 9 import net.minecraft.client.render.block.BlockRenderManager; 11 10 import net.minecraft.client.render.entity.LivingEntityRenderer; ··· 13 12 import net.minecraft.client.render.entity.feature.FeatureRendererContext; 14 13 import net.minecraft.client.render.entity.model.SlimeEntityModel; 15 14 import net.minecraft.client.render.model.BlockStateModel; 15 + import net.minecraft.client.texture.SpriteAtlasTexture; 16 16 import net.minecraft.client.util.math.MatrixStack; 17 17 import net.minecraft.util.math.BlockPos; 18 18 ··· 34 34 matrixStack.push(); 35 35 matrixStack.scale(0.25f, 0.25f, 0.25f); 36 36 matrixStack.translate(-0.5f, 4.5f, -0.5f); 37 - this.renderCore(matrixStack, vertexConsumerProvider, light, blockState, m); 37 + this.renderCore(matrixStack, vertexConsumerProvider.getBuffer(RenderLayer.getEntityTranslucent(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE)), light, blockState, m); 38 38 matrixStack.pop(); 39 39 } 40 40 41 - private void renderCore(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, BlockState coreState, int overlay) { 41 + private void renderCore(MatrixStack matrices, VertexConsumer vertexConsumers, int light, BlockState coreState, int overlay) { 42 42 BlockStateModel coreModel = this.blockRenderManager.getModel(coreState); 43 - FabricBlockModelRenderer.render(matrices.peek(), vertexConsumers, coreModel, 1.0f, 1.0f, 1.0f, light, overlay, null, BlockPos.ORIGIN, coreState); 43 + FabricBlockModelRenderer.render(matrices.peek(), layer-> vertexConsumers, coreModel, 1.0f, 1.0f, 1.0f, light, overlay, null, BlockPos.ORIGIN, coreState); 44 44 } 45 45 }
+8 -6
common/src/main/java/net/lerariemann/infinity/entity/custom/AbstractChessFigure.java
··· 15 15 import net.minecraft.server.world.ServerWorld; 16 16 import net.minecraft.sound.SoundEvent; 17 17 import net.minecraft.sound.SoundEvents; 18 + import net.minecraft.storage.ReadView; 19 + import net.minecraft.storage.WriteView; 18 20 import net.minecraft.util.TimeHelper; 19 21 import net.minecraft.util.math.BlockPos; 20 22 import net.minecraft.util.math.Box; ··· 91 93 } 92 94 93 95 @Override 94 - public void writeCustomDataToNbt(NbtCompound nbt) { 95 - super.writeCustomDataToNbt(nbt); 96 - this.writeAngerToNbt(nbt); 96 + public void writeCustomData(WriteView nbt) { 97 + super.writeCustomData(nbt); 98 + this.writeAngerToData(nbt); 97 99 } 98 100 @Override 99 - public void readCustomDataFromNbt(NbtCompound nbt) { 100 - super.readCustomDataFromNbt(nbt); 101 - this.readAngerFromNbt(this.getWorld(), nbt); 101 + public void readCustomData(ReadView nbt) { 102 + super.readCustomData(nbt); 103 + this.readAngerFromData(this.getWorld(), nbt); 102 104 } 103 105 104 106 @Override
+8 -11
common/src/main/java/net/lerariemann/infinity/entity/custom/AntEntity.java
··· 19 19 import net.minecraft.registry.tag.FluidTags; 20 20 import net.minecraft.sound.SoundEvent; 21 21 import net.minecraft.sound.SoundEvents; 22 + import net.minecraft.storage.ReadView; 23 + import net.minecraft.storage.WriteView; 22 24 import net.minecraft.util.ActionResult; 23 25 import net.minecraft.util.Hand; 24 26 import net.minecraft.util.math.BlockPos; ··· 89 91 } 90 92 91 93 @Override 92 - public void readCustomDataFromNbt(NbtCompound nbt) { 93 - super.readCustomDataFromNbt(nbt); 94 + public void readCustomData(ReadView nbt) { 95 + super.readCustomData(nbt); 94 96 this.dropsLoot = NbtUtils.getBoolean(nbt, "dropsLoot", true); 95 97 this.direction = switch(NbtUtils.getString(nbt, "direction")) { 96 98 case "N" -> Direction.NORTH; ··· 99 101 default -> Direction.EAST; 100 102 }; 101 103 if (nbt.contains("last_changed_pos")) { 102 - NbtCompound pos = NbtUtils.getCompound(nbt, "last_changed_pos"); 103 - this.lastChangedPos = new BlockPos(NbtUtils.getInt(pos, "x"), NbtUtils.getInt(nbt,"y"), NbtUtils.getInt(nbt, "z")); 104 + this.lastChangedPos = nbt.read("last_changed_pos", BlockPos.CODEC).get(); 104 105 } 105 106 } 106 107 107 108 @Override 108 - public void writeCustomDataToNbt(NbtCompound nbt) { 109 - super.writeCustomDataToNbt(nbt); 109 + public void writeData(WriteView nbt) { 110 + super.writeCustomData(nbt); 110 111 nbt.putBoolean("dropsLoot", dropsLoot); 111 112 nbt.putString("direction", switch(this.direction) { 112 113 case Direction.NORTH -> "N"; ··· 115 116 default -> "E"; 116 117 }); 117 118 if (lastChangedPos != null) { 118 - NbtCompound pos = new NbtCompound(); 119 - pos.putInt("x", lastChangedPos.getX()); 120 - pos.putInt("y", lastChangedPos.getY()); 121 - pos.putInt("z", lastChangedPos.getZ()); 122 - nbt.put("last_changed_pos", pos); 119 + nbt.put("last_changed_pos", BlockPos.CODEC, lastChangedPos); 123 120 } 124 121 } 125 122
+6 -4
common/src/main/java/net/lerariemann/infinity/entity/custom/BishopEntity.java
··· 23 23 import net.minecraft.nbt.NbtCompound; 24 24 import net.minecraft.server.world.ServerWorld; 25 25 import net.minecraft.sound.SoundEvents; 26 + import net.minecraft.storage.ReadView; 27 + import net.minecraft.storage.WriteView; 26 28 import net.minecraft.world.LocalDifficulty; 27 29 import net.minecraft.world.ServerWorldAccess; 28 30 import net.minecraft.world.World; ··· 129 131 } 130 132 131 133 @Override 132 - public void writeCustomDataToNbt(NbtCompound nbt) { 133 - super.writeCustomDataToNbt(nbt); 134 + public void writeCustomData(WriteView nbt) { 135 + super.writeCustomData(nbt); 134 136 if (battle != null) nbt.putString("battle", battle.teamName); 135 137 } 136 138 @Override 137 - public void readCustomDataFromNbt(NbtCompound nbt) { 138 - super.readCustomDataFromNbt(nbt); 139 + public void readCustomData(ReadView nbt) { 140 + super.readCustomData(nbt); 139 141 if (nbt.contains("battle") && getWorld() instanceof ServerWorld w) 140 142 battle = new BishopBattle(w, NbtUtils.getString(nbt, "battle")); 141 143 updateAttackType();
+6 -4
common/src/main/java/net/lerariemann/infinity/entity/custom/ChaosCreeper.java
··· 31 31 import net.minecraft.server.MinecraftServer; 32 32 import net.minecraft.server.world.ServerWorld; 33 33 import net.minecraft.sound.SoundEvents; 34 + import net.minecraft.storage.ReadView; 35 + import net.minecraft.storage.WriteView; 34 36 import net.minecraft.util.ActionResult; 35 37 import net.minecraft.util.Hand; 36 38 import net.minecraft.util.Identifier; ··· 104 106 } 105 107 106 108 @Override 107 - public void writeCustomDataToNbt(NbtCompound nbt) { 108 - super.writeCustomDataToNbt(nbt); 109 + public void writeCustomData(WriteView nbt) { 110 + super.writeCustomData(nbt); 109 111 nbt.putFloat("range", this.getRange()); 110 112 nbt.putInt("color", this.getColor()); 111 113 nbt.putString("biome", this.getBiome()); 112 114 } 113 115 114 116 @Override 115 - public void readCustomDataFromNbt(NbtCompound nbt) { 116 - super.readCustomDataFromNbt(nbt); 117 + public void readCustomData(ReadView nbt) { 118 + super.readCustomData(nbt); 117 119 this.setRange(NbtUtils.getFloat(nbt, "range")); 118 120 this.setColor(NbtUtils.getInt(nbt, "color")); 119 121 this.setBiome(NbtUtils.getString(nbt, "biome"));
+29 -16
common/src/main/java/net/lerariemann/infinity/entity/custom/ChaosPawn.java
··· 1 1 package net.lerariemann.infinity.entity.custom; 2 2 3 + import com.mojang.serialization.Codec; 3 4 import net.lerariemann.infinity.InfinityMod; 4 5 import net.lerariemann.infinity.iridescence.Iridescence; 5 6 import net.lerariemann.infinity.util.core.ConfigType; ··· 21 22 import net.minecraft.entity.data.TrackedDataHandlerRegistry; 22 23 import net.minecraft.entity.mob.*; 23 24 import net.minecraft.item.ItemStack; 24 - import net.minecraft.loot.LootTable; 25 25 import net.minecraft.nbt.NbtCompound; 26 26 import net.minecraft.registry.Registries; 27 - import net.minecraft.registry.RegistryKey; 28 - import net.minecraft.registry.RegistryKeys; 29 27 import net.minecraft.server.world.ServerWorld; 28 + import net.minecraft.storage.ReadView; 29 + import net.minecraft.storage.WriteView; 30 30 import net.minecraft.text.Text; 31 31 import net.minecraft.util.Identifier; 32 + import net.minecraft.util.dynamic.Codecs; 32 33 import net.minecraft.world.*; 33 34 import org.jetbrains.annotations.Nullable; 34 35 ··· 42 43 public ChaosPawn(EntityType<? extends ChaosPawn> entityType, World world) { 43 44 super(entityType, world); 44 45 } 45 - public void setColors(NbtCompound i) { 46 - this.dataTracker.set(colors, i); 46 + public void setColors(Map<String, Integer> i) { 47 + NbtCompound nbtCompound = new NbtCompound(); 48 + Arrays.stream((new String[]{"body", "left_arm", "right_arm", "left_leg", "right_leg", "head", "hat"})).forEach( 49 + s -> nbtCompound.putInt(s, i.get(s))); 50 + this.dataTracker.set(colors, nbtCompound); 47 51 } 52 + 53 + public LinkedHashMap<String, Integer> getColorMap(NbtCompound nbtCompound) { 54 + LinkedHashMap<String, Integer> i = new LinkedHashMap<>(); 55 + Arrays.stream((new String[]{"body", "left_arm", "right_arm", "left_leg", "right_leg", "head", "hat"})).forEach( 56 + s -> nbtCompound.putInt(s, nbtCompound.getInt(s, 0))); 57 + return i; 58 + } 59 + 48 60 public NbtCompound getColors() { 49 61 return this.dataTracker.get(colors); 50 62 } ··· 88 100 } 89 101 90 102 @Override 91 - public void writeCustomDataToNbt(NbtCompound nbt) { 92 - super.writeCustomDataToNbt(nbt); 93 - nbt.put("colors", getColors()); 103 + public void writeCustomData(WriteView nbt) { 104 + super.writeCustomData(nbt); 105 + nbt.put("colors", Codec.unboundedMap(Codecs.NON_EMPTY_STRING, Codecs.POSITIVE_INT), getColorMap(getColors())); 94 106 nbt.putInt("case", getCase()); 95 107 } 96 108 @Override 97 - public void readCustomDataFromNbt(NbtCompound nbt) { 98 - super.readCustomDataFromNbt(nbt); 99 - this.setColors(NbtUtils.getCompound(nbt, "colors")); 109 + public void readCustomData(ReadView nbt) { 110 + super.readCustomData(nbt); 111 + this.setColors(nbt.read("colors", Codec.unboundedMap(Codecs.NON_EMPTY_STRING, Codecs.POSITIVE_INT)).get()); 100 112 this.dataTracker.set(special_case, NbtUtils.getInt(nbt, "case")); 101 113 } 102 114 ··· 115 127 // return RegistryKey.of(RegistryKeys.LOOT_TABLE, i); 116 128 // } 117 129 118 - public static NbtCompound getColorSetup(Supplier<Integer> colorSupplier) { 119 - NbtCompound c = new NbtCompound(); 130 + public static LinkedHashMap<String, Integer> getColorSetup(Supplier<Integer> colorSupplier) { 131 + LinkedHashMap<String, Integer> c = new LinkedHashMap<>(); 120 132 Arrays.stream((new String[]{"body", "left_arm", "right_arm", "left_leg", "right_leg"})).forEach( 121 - s -> c.putInt(s, colorSupplier.get())); 133 + s -> c.put(s, colorSupplier.get())); 122 134 int head = colorSupplier.get(); 123 - c.putInt("head", head); 124 - c.putInt("hat", 0xFFFFFF ^ head); 135 + c.put("head", head); 136 + c.put("hat", 0xFFFFFF ^ head); 125 137 return c; 126 138 } 139 + 127 140 128 141 public void setAllColors(int color) { 129 142 this.setColors(getColorSetup(() -> color));
+6 -4
common/src/main/java/net/lerariemann/infinity/entity/custom/ChaosSkeleton.java
··· 32 32 import net.minecraft.registry.entry.RegistryEntry; 33 33 import net.minecraft.server.world.ServerWorld; 34 34 import net.minecraft.sound.SoundEvents; 35 + import net.minecraft.storage.ReadView; 36 + import net.minecraft.storage.WriteView; 35 37 import net.minecraft.text.Text; 36 38 import net.minecraft.util.ActionResult; 37 39 import net.minecraft.util.Hand; ··· 171 173 return this.dataTracker.get(duration); 172 174 } 173 175 @Override 174 - public void writeCustomDataToNbt(NbtCompound nbt) { 175 - super.writeCustomDataToNbt(nbt); 176 + public void writeCustomData(WriteView nbt) { 177 + super.writeCustomData(nbt); 176 178 nbt.putString("effect", this.getEffect()); 177 179 nbt.putInt("duration", this.getDuration()); 178 180 nbt.putInt("color", this.getColor()); 179 181 } 180 182 @Override 181 - public void readCustomDataFromNbt(NbtCompound nbt) { 182 - super.readCustomDataFromNbt(nbt); 183 + public void readCustomData(ReadView nbt) { 184 + super.readCustomData(nbt); 183 185 this.setEffect(NbtUtils.getString(nbt, "effect"), NbtUtils.getInt(nbt, "color")); 184 186 this.setDuration(NbtUtils.getInt(nbt,"duration")); 185 187 }
+6 -4
common/src/main/java/net/lerariemann/infinity/entity/custom/ChaosSlime.java
··· 25 25 import net.minecraft.registry.Registries; 26 26 import net.minecraft.registry.RegistryKey; 27 27 import net.minecraft.sound.SoundEvent; 28 + import net.minecraft.storage.ReadView; 29 + import net.minecraft.storage.WriteView; 28 30 import net.minecraft.util.Identifier; 29 31 import net.minecraft.util.math.BlockPos; 30 32 import net.minecraft.world.*; ··· 115 117 } 116 118 117 119 @Override 118 - public void writeCustomDataToNbt(NbtCompound nbt) { 119 - super.writeCustomDataToNbt(nbt); 120 + public void writeCustomData(WriteView nbt) { 121 + super.writeCustomData(nbt); 120 122 nbt.putInt("color", getColor()); 121 123 nbt.putString("core", Registries.BLOCK.getId(this.getCore().getBlock()).toString()); 122 124 } 123 125 124 126 @Override 125 - public void readCustomDataFromNbt(NbtCompound nbt) { 126 - super.readCustomDataFromNbt(nbt); 127 + public void readCustomData(ReadView nbt) { 128 + super.readCustomData(nbt); 127 129 this.setColor(NbtUtils.getInt(nbt, "color")); 128 130 Block b = Registries.BLOCK.get(Identifier.of(NbtUtils.getString(nbt,"core"))); 129 131 this.setCore(b.getDefaultState());
+2 -2
common/src/main/java/net/lerariemann/infinity/entity/custom/TintableEntity.java
··· 21 21 int p = n % o; 22 22 int q = (n + 1) % o; 23 23 float r = (float)(age % 25) / 25.0F; 24 - int s = SheepEntity.getRgbColor(DyeColor.byIndex(p)); 25 - int t = SheepEntity.getRgbColor(DyeColor.byIndex(q)); 24 + int s = DyeColor.byIndex(p).getEntityColor(); 25 + int t = DyeColor.byIndex(q).getEntityColor(); 26 26 return ColorHelper.lerp(r, s, t); 27 27 } 28 28
+5 -5
common/src/main/java/net/lerariemann/infinity/iridescence/Iridescence.java
··· 189 189 } 190 190 191 191 static void loadShader(ServerPlayerEntity player) { 192 - ModPayloads.sendShaderPayload(player, player.getServerWorld(), true); 192 + ModPayloads.sendShaderPayload(player, player.getWorld(), true); 193 193 } 194 194 static void unloadShader(ServerPlayerEntity player) { 195 - ModPayloads.sendShaderPayload(player, player.getServerWorld(), false); 195 + ModPayloads.sendShaderPayload(player, player.getWorld(), false); 196 196 } 197 197 198 198 static boolean shouldApplyShader(@Nullable PlayerEntity player) { ··· 224 224 compound.putDouble("x", player.getPos().x); 225 225 compound.putDouble("y", player.getPos().y); 226 226 compound.putDouble("z", player.getPos().z); 227 - compound.putString("dim", player.getServerWorld().getRegistryKey().getValue().toString()); 227 + compound.putString("dim", player.getWorld().getRegistryKey().getValue().toString()); 228 228 CommonIO.write(compound, InfinityMod.provider.savingPath, player.getUuidAsString() + ".json"); 229 229 } 230 230 ··· 239 239 Path cookie = InfinityMod.provider.savingPath.resolve(player.getUuidAsString() + ".json"); 240 240 try { 241 241 NbtCompound comp = CommonIO.read(cookie); 242 - player.teleport(player.server.getWorld(RegistryKey.of(RegistryKeys.WORLD, Identifier.of(NbtUtils.getString(comp, "dim")))), 242 + player.teleport(player.getWorld().getServer().getWorld(RegistryKey.of(RegistryKeys.WORLD, Identifier.of(NbtUtils.getString(comp, "dim")))), 243 243 NbtUtils.getDouble(comp, "x"), NbtUtils.getDouble(comp, "y"), NbtUtils.getDouble(comp, "z"), Set.of(), player.getYaw(), player.getPitch(), false); 244 244 } catch (Exception e) { 245 245 WarpLogic.respawnAlive(player); ··· 251 251 } 252 252 253 253 static Identifier getIdForWarp(ServerPlayerEntity player) { 254 - ServerWorld w = player.getServerWorld().getServer().getOverworld(); 254 + ServerWorld w = player.getWorld().getServer().getOverworld(); 255 255 return InfinityMethods.getRandomId(new Random(w.getSeed() + w.getTime() / ticksInHour)); 256 256 } 257 257
+2 -2
common/src/main/java/net/lerariemann/infinity/iridescence/IridescentEffect.java
··· 16 16 import net.minecraft.entity.mob.Angerable; 17 17 import net.minecraft.entity.mob.MobEntity; 18 18 import net.minecraft.entity.player.PlayerEntity; 19 - import net.minecraft.particle.EntityEffectParticleEffect; 20 19 import net.minecraft.particle.ParticleEffect; 21 20 import net.minecraft.particle.ParticleTypes; 21 + import net.minecraft.particle.TintedParticleEffect; 22 22 import net.minecraft.server.network.ServerPlayerEntity; 23 23 import net.minecraft.sound.SoundEvents; 24 24 import net.minecraft.util.Identifier; ··· 107 107 @Override 108 108 public ParticleEffect createParticle(StatusEffectInstance effect) { 109 109 float hue = effect.getDuration() / 13.0f; 110 - return EntityEffectParticleEffect.create( 110 + return TintedParticleEffect.create( 111 111 ParticleTypes.ENTITY_EFFECT, ColorHelper.fullAlpha(Color.HSBtoRGB(hue - (int)hue, 1.0f, 1.0f))); 112 112 } 113 113
+3 -3
common/src/main/java/net/lerariemann/infinity/mixin/core/ServerPlayerEntityMixin.java
··· 34 34 @Mixin(ServerPlayerEntity.class) 35 35 public abstract class ServerPlayerEntityMixin extends PlayerEntity implements ServerPlayerEntityAccess { 36 36 public ServerPlayerEntityMixin(World world, BlockPos pos, float yaw, GameProfile gameProfile) { 37 - super(world, pos, yaw, gameProfile); 37 + super(world, gameProfile); 38 38 } 39 39 40 - @Shadow public abstract ServerWorld getServerWorld(); 40 + @Shadow public abstract ServerWorld getWorld(); 41 41 @Shadow public abstract @Nullable Entity teleportTo(TeleportTarget teleportTarget); 42 42 @Unique private long infinity$ticksUntilWarp; 43 43 @Unique private Identifier infinity$idForWarp; ··· 64 64 if (--this.infinity$ticksUntilWarp == 0L) 65 65 WarpLogic.performWarp(player, infinity$idForWarp); 66 66 /* Handle effects from dimension deletion */ 67 - ((Timebombable)getServerWorld()).tickTimebombProgress(player); 67 + ((Timebombable)getWorld()).tickTimebombProgress(player); 68 68 } 69 69 70 70 @Inject(method = "changeGameMode", at = @At("RETURN"))
+12 -12
common/src/main/java/net/lerariemann/infinity/mixin/fixes/BeeGoalMixin.java
··· 12 12 * I fixed that :D */ 13 13 @Mixin(BeeEntity.MoveToHiveGoal.class) 14 14 public abstract class BeeGoalMixin { 15 - @WrapOperation(method = "<init>", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/random/Random;nextInt(I)I")) 16 - private int inj(Random instance, int i, Operation<Integer> original) { 17 - return 10; 18 - } 19 - 20 - @Mixin(BeeEntity.MoveToFlowerGoal.class) 21 - public abstract static class BeeGoalMixin2 { 22 - @WrapOperation(method = "<init>", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/random/Random;nextInt(I)I")) 23 - private int inj(Random instance, int i, Operation<Integer> original) { 24 - return 10; 25 - } 26 - } 15 + // @WrapOperation(method = "<init>", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/random/Random;nextInt(I)I")) 16 + // private int inj(Random instance, int i, Operation<Integer> original) { 17 + // return 10; 18 + // } 19 + // 20 + // @Mixin(BeeEntity.MoveToFlowerGoal.class) 21 + // public abstract static class BeeGoalMixin2 { 22 + // @WrapOperation(method = "<init>", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/random/Random;nextInt(I)I")) 23 + // private int inj(Random instance, int i, Operation<Integer> original) { 24 + // return 10; 25 + // } 26 + // } 27 27 }
+12 -13
common/src/main/java/net/lerariemann/infinity/mixin/options/BackgroundRendererMixin.java
··· 5 5 import net.lerariemann.infinity.options.InfinityOptions; 6 6 import net.lerariemann.infinity.util.InfinityMethods; 7 7 import net.minecraft.block.enums.CameraSubmersionType; 8 - import net.minecraft.client.render.BackgroundRenderer; 9 8 import net.minecraft.client.render.Camera; 9 + import net.minecraft.client.render.fog.FogRenderer; 10 10 import net.minecraft.client.world.ClientWorld; 11 11 import net.minecraft.util.math.MathHelper; 12 12 import org.joml.Vector4f; 13 13 import org.spongepowered.asm.mixin.Mixin; 14 - import org.spongepowered.asm.mixin.Shadow; 15 14 import org.spongepowered.asm.mixin.Unique; 16 15 import org.spongepowered.asm.mixin.injection.At; 17 16 import org.spongepowered.asm.mixin.injection.Inject; 18 - import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 19 17 import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 20 18 21 19 import java.awt.Color; 22 20 23 - @Mixin(BackgroundRenderer.class) 21 + @Mixin(FogRenderer.class) 24 22 public class BackgroundRendererMixin { 25 23 //TODO fix 26 24 // @Shadow ··· 32 30 33 31 34 32 @Inject(method = "getFogColor", 35 - at= @At(value = "INVOKE", target = "Lnet/minecraft/client/render/BackgroundRenderer;getFogModifier(Lnet/minecraft/entity/Entity;F)Lnet/minecraft/client/render/BackgroundRenderer$StatusEffectFogModifier;")) 36 - private static void injected(Camera camera, float tickDelta, ClientWorld world, int clampedViewDistance, float skyDarkness, CallbackInfoReturnable<Vector4f> cir) { 33 + at= @At(value = "INVOKE", target = "Lnet/minecraft/client/render/fog/FogModifier;getFogColor(Lnet/minecraft/client/world/ClientWorld;Lnet/minecraft/client/render/Camera;IF)I")) 34 + private static void injected(Camera camera, float tickProgress, ClientWorld world, int viewDistance, float skyDarkness, boolean thick, CallbackInfoReturnable<Vector4f> cir) { 37 35 InfinityOptions options = InfinityOptions.access(world); 38 36 if (options.getSkyType().equals("rainbow") && camera.getSubmersionType() == CameraSubmersionType.NONE) { 39 - infinity$applyRainbowFog(world, tickDelta); 37 + infinity$applyRainbowFog(world, tickProgress); 40 38 } 41 39 } 42 40 43 41 /* Disable void fog in custom dimensions. */ 44 - @ModifyExpressionValue(method = "getFogColor", 45 - at = @At(value = "INVOKE", target = "Lnet/minecraft/client/world/ClientWorld$Properties;getHorizonShadingRatio()F")) 46 - private static float inj(float original, @Local(argsOnly = true) ClientWorld world) { 47 - if (!InfinityMethods.isInfinity(world)) return original; 48 - return InfinityOptions.access(world).getHorizonShadingRatio(); 49 - } 42 + //FIXME 43 + // @ModifyExpressionValue(method = "getFogColor", 44 + // at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/fog/FogModifier;shouldApply(Lnet/minecraft/block/enums/CameraSubmersionType;Lnet/minecraft/entity/Entity;)Z")) 45 + // private static boolean inj(boolean original, @Local(argsOnly = true) ClientWorld world) { 46 + // if (!InfinityMethods.isInfinity(world)) return original; 47 + // return InfinityOptions.access(world).getHorizonShadingRatio(); 48 + // } 50 49 51 50 @Unique 52 51 private static void infinity$applyRainbowFog(ClientWorld world, float tickDelta) {
+2 -4
common/src/main/java/net/lerariemann/infinity/mixin/options/GameRendererMixin.java
··· 17 17 18 18 @Mixin(GameRenderer.class) 19 19 public abstract class GameRendererMixin implements GameRendererAccess { 20 - @Shadow 21 - @Final 22 - private ResourceManager resourceManager; 20 + 23 21 @Shadow 24 22 protected abstract void setPostProcessor(Identifier id); 25 23 26 24 @Override 27 25 public void infinity$loadPP(Identifier id) { 28 - if (resourceManager.getResource(id).isPresent()) { 26 + if (MinecraftClient.getInstance().getResourceManager().getResource(id).isPresent()) { 29 27 setPostProcessor(id); 30 28 } 31 29 else {
+1 -1
common/src/main/java/net/lerariemann/infinity/mixin/options/PlayerManagerMixin.java
··· 60 60 } 61 61 InfinityMod.LOGGER.info("Sending sound pack to client"); 62 62 if (RandomProvider.rule("useSoundSyncPackets")) ModPayloads.sendSoundPackPayload(player, CommonIO.read( 63 - player.server.getSavePath(WorldSavePath.DATAPACKS).resolve("client_sound_pack_data.json"))); 63 + player.getWorld().getServer().getSavePath(WorldSavePath.DATAPACKS).resolve("client_sound_pack_data.json"))); 64 64 } 65 65 66 66 @Inject(method="sendWorldInfo", at = @At("TAIL"))
+2 -2
common/src/main/java/net/lerariemann/infinity/registry/var/ModPayloads.java
··· 83 83 } 84 84 } 85 85 public static void sendShaderPayload(ServerPlayerEntity player) { 86 - sendShaderPayload(player, player.getServerWorld(), Iridescence.shouldApplyShader(player)); 86 + sendShaderPayload(player, player.getWorld(), Iridescence.shouldApplyShader(player)); 87 87 } 88 88 public static void sendShaderPayload(ServerPlayerEntity player, ServerWorld world) { 89 89 sendShaderPayload(player, world, Iridescence.shouldApplyShader(player)); ··· 158 158 public static void receiveF4DeployPayload(ServerPlayerEntity player) { 159 159 ItemStack st = player.getStackInHand(Hand.MAIN_HAND); 160 160 if (st.isOf(ModItems.F4.get())) { 161 - ActionResult result = F4Item.deploy(player.getServerWorld(), player, Hand.MAIN_HAND); 161 + ActionResult result = F4Item.deploy(player.getWorld(), player, Hand.MAIN_HAND); 162 162 // player.setStackInHand(Hand.MAIN_HAND, result); 163 163 } 164 164 }
+1 -1
common/src/main/java/net/lerariemann/infinity/util/config/ConfigGenInvocation.java
··· 21 21 public BlockPos pos; 22 22 23 23 public static void invokeOn(ServerPlayerEntity player) { 24 - ServerWorld w = player.getServerWorld(); 24 + ServerWorld w = player.getWorld(); 25 25 int y = w.getHeight() - 10; 26 26 BlockPos pos = new BlockPos(player.getBlockX(), y, player.getBlockZ()); 27 27 (new ConfigGenInvocation(w, pos)).run();
+3 -3
common/src/main/java/net/lerariemann/infinity/util/config/ConfigGenerator.java
··· 305 305 } 306 306 307 307 static void generateLootTables(ReloadableRegistries.Lookup reloadableRegistries) { 308 - var r = reloadableRegistries.getIds(RegistryKeys.LOOT_TABLE); 308 + var r = reloadableRegistries.createRegistryLookup().getOrThrow(RegistryKeys.LOOT_TABLE); 309 309 DataCollection lootTables = new DataCollection.Logged(ConfigType.LOOT_TABLES, "loot tables"); 310 - r.forEach(id -> { 311 - lootTables.addIdentifier(id); 310 + r.streamKeys().forEach(id -> { 311 + lootTables.addIdentifier(id.getValue()); 312 312 }); 313 313 lootTables.save(); 314 314 }
+20
common/src/main/java/net/lerariemann/infinity/util/core/NbtUtils.java
··· 4 4 import net.minecraft.nbt.NbtCompound; 5 5 import net.minecraft.nbt.NbtElement; 6 6 import net.minecraft.nbt.NbtList; 7 + import net.minecraft.storage.ReadView; 8 + import net.minecraft.storage.WriteView; 7 9 8 10 import java.util.Random; 9 11 ··· 20 22 } 21 23 static int getInt(NbtCompound data, String key, int def) { 22 24 return (NbtUtils.getType(data, key) == NbtElement.INT_TYPE) ? NbtUtils.getInt(data, key) : def; 25 + } 26 + static int getInt(ReadView data, String key, int def) { 27 + return NbtUtils.getInt(data, key); 23 28 } 24 29 static double getDouble(NbtCompound data, String key, double def) { 25 30 return (NbtUtils.getType(data, key) == NbtElement.DOUBLE_TYPE) ? NbtUtils.getDouble(data, key) : def; ··· 27 32 static boolean getBoolean(NbtCompound data, String key, boolean def) { 28 33 return (data.contains(key)) ? NbtUtils.getBoolean(data, key) : def; 29 34 } 35 + static boolean getBoolean(ReadView data, String key, boolean def) { 36 + return NbtUtils.getBoolean(data, key); 37 + } 30 38 31 39 static String getString(NbtCompound data, String key) { 32 40 return data.getString(key).orElse(""); 33 41 } 42 + static String getString(ReadView data, String key) { 43 + return data.getString(key, ""); 44 + } 34 45 static NbtCompound getCompound(NbtCompound data, String key) { 35 46 return data.getCompound(key).orElse(new NbtCompound()); 36 47 } 37 48 static float getFloat(NbtCompound data, String key) { 38 49 return data.getFloat(key).orElse(0f); 39 50 } 51 + static float getFloat(ReadView data, String key) { 52 + return data.getFloat(key, 0f); 53 + } 40 54 static int getInt(NbtCompound data, String key) { 41 55 return data.getInt(key).orElse(0); 42 56 } 57 + static int getInt(ReadView data, String key) { 58 + return data.getInt(key, 0); 59 + } 43 60 static double getDouble(NbtCompound data, String key) { 44 61 return data.getDouble(key).orElse(0d); 45 62 } 46 63 static boolean getBoolean(NbtCompound data, String key) { 47 64 return data.getBoolean(key).orElse(false); 65 + } 66 + static boolean getBoolean(ReadView data, String key) { 67 + return data.getBoolean(key, false); 48 68 } 49 69 static short getShort(NbtCompound data, String key) { 50 70 return data.getShort(key).get();
+2 -1
common/src/main/java/net/lerariemann/infinity/util/screen/F4Screen.java
··· 3 3 import net.fabricmc.api.EnvType; 4 4 import net.fabricmc.api.Environment; 5 5 import net.lerariemann.infinity.util.InfinityMethods; 6 + import net.minecraft.client.gl.RenderPipelines; 6 7 import net.minecraft.client.gui.DrawContext; 7 8 import net.minecraft.client.gui.screen.ingame.*; 8 9 import net.minecraft.client.gui.widget.TextFieldWidget; ··· 80 81 81 82 @Override 82 83 protected void drawBackground(DrawContext context, float delta, int mouseX, int mouseY) { 83 - context.drawGuiTexture(RenderLayer::getGuiTextured, InfinityMethods.getId("textures/gui/f4.png"), 84 + context.drawGuiTexture(RenderPipelines.GUI_TEXTURED, InfinityMethods.getId("textures/gui/f4.png"), 84 85 x, y, this.backgroundWidth, this.backgroundHeight); 85 86 } 86 87 }
+2 -2
common/src/main/java/net/lerariemann/infinity/util/teleport/WarpLogic.java
··· 83 83 * Moves the player to a specified existing dimension. 84 84 */ 85 85 static void performWarp(ServerPlayerEntity player, Identifier idForWarp) { 86 - MinecraftServer s = player.getServerWorld().getServer(); 86 + MinecraftServer s = player.getServer(); 87 87 RegistryKey<World> key = RegistryKey.of(RegistryKeys.WORLD, idForWarp); 88 88 ServerWorld w = s.getWorld(key); 89 89 if (w==null) { ··· 91 91 return; 92 92 } 93 93 94 - double d = DimensionType.getCoordinateScaleFactor(player.getServerWorld().getDimension(), w.getDimension()); 94 + double d = DimensionType.getCoordinateScaleFactor(player.getWorld().getDimension(), w.getDimension()); 95 95 double y = MathHelper.clamp(player.getY(), w.getBottomY(), w.getHeight()); 96 96 97 97 BlockPos blockPos2 = getPosForWarp(BlockPos.ofFloored(w.getWorldBorder().clamp(player.getX() * d, y, player.getZ() * d)), w);
+5 -4
fabric/src/main/java/net/lerariemann/infinity/fabric/client/InfinityModFabricClient.java
··· 1 1 package net.lerariemann.infinity.fabric.client; 2 2 3 3 import net.fabricmc.api.ClientModInitializer; 4 - import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap; 5 4 import net.fabricmc.fabric.api.client.render.fluid.v1.FluidRenderHandlerRegistry; 5 + import net.fabricmc.fabric.api.client.rendering.v1.BlockRenderLayerMap; 6 6 import net.fabricmc.fabric.api.client.rendering.v1.ColorProviderRegistry; 7 7 import net.fabricmc.fabric.api.transfer.v1.client.fluid.FluidVariantRendering; 8 8 import net.fabricmc.fabric.api.transfer.v1.fluid.FluidVariantAttributes; ··· 14 14 import net.lerariemann.infinity.registry.core.ModItemFunctions; 15 15 import net.lerariemann.infinity.registry.core.ModItems; 16 16 import net.lerariemann.infinity.util.InfinityMethods; 17 + import net.minecraft.client.render.BlockRenderLayer; 17 18 import net.minecraft.client.render.RenderLayer; 18 19 19 20 public class InfinityModFabricClient implements ClientModInitializer { ··· 29 30 ModBlocks.CHROMATIC_CARPET.get()); 30 31 31 32 // Render layer maps 32 - BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutoutMipped(), 33 + BlockRenderLayerMap.putBlocks(BlockRenderLayer.CUTOUT_MIPPED, 33 34 ModBlocks.BOOK_BOX.get(), 34 35 ModBlocks.IRIDESCENT_KELP.get(), 35 36 ModBlocks.IRIDESCENT_KELP_PLANT.get()); 36 - BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getTranslucent(), 37 + BlockRenderLayerMap.putBlocks(BlockRenderLayer.TRANSLUCENT, 37 38 ModBlocks.TIME_BOMB.get(), 38 39 ModBlocks.BIOME_BOTTLE.get(), 39 40 ModBlocks.CHROMATIC_WOOL.get(), 40 41 ModBlocks.CHROMATIC_CARPET.get()); 41 - BlockRenderLayerMap.INSTANCE.putFluids(RenderLayer.getTranslucent(), 42 + BlockRenderLayerMap.putFluids(BlockRenderLayer.TRANSLUCENT, 42 43 PlatformMethods.getIridescenceStill().get(), 43 44 PlatformMethods.getIridescenceFlowing().get()); 44 45
+1 -1
fabric/src/main/resources/fabric.mod.json
··· 38 38 "depends": { 39 39 "fabricloader": ">=0.15.11", 40 40 "fabric-api": "*", 41 - "minecraft": "1.21.5", 41 + "minecraft": "~1.21.6", 42 42 "java": ">=21", 43 43 "architectury": "*" 44 44 },
+8 -8
gradle.properties
··· 6 6 mod_version = 2.5.2 7 7 maven_group = net.lerariemann 8 8 archives_name = infinity 9 - enabled_platforms = fabric,neoforge 9 + enabled_platforms = fabric 10 10 tbversion = 1 11 11 12 12 # Minecraft properties 13 - minecraft_version = 1.21.5 13 + minecraft_version = 1.21.8 14 14 yarn_mappings = 1 15 15 16 16 # Dependencies 17 - architectury_api_version = 16.1.4 17 + architectury_api_version = 17.0.8 18 18 19 19 # Fabric Dependencies 20 - fabric_loader_version = 0.16.13 21 - fabric_api_version = 0.128.1+1.21.5 20 + fabric_loader_version = 0.17.3 21 + fabric_api_version = 0.136.0+1.21.8 22 22 23 23 # NeoForge Dependencies 24 24 neoforge_version = 21.5.81 ··· 36 36 37 37 # Optional Dependencies 38 38 catalogue_version = 5631367 39 - cloth_version = 18.0.145 40 - modmenu_version = 14.0.0-rc.2 39 + cloth_version = 19.0.147 40 + modmenu_version = 15.0.0 41 41 emi_version = 1.1.18 42 42 cct_version = 1.115.0 43 43 dimlib_version = v1.1.0-mc1.21.1 44 - eiv_version = 2.5.3 44 + eiv_version = 4.1.0
+1 -1
settings.gradle
··· 15 15 16 16 include 'common' 17 17 include 'fabric' 18 - include 'neoforge' 18 + //include 'neoforge'