diff --git a/game/client/src/main/java/net/minecraft/client/render/entity/MobRendererBiped.java b/game/client/src/main/java/net/minecraft/client/render/entity/MobRendererBiped.java index c07cb3fcc..f8620f4e9 100644 --- a/game/client/src/main/java/net/minecraft/client/render/entity/MobRendererBiped.java +++ b/game/client/src/main/java/net/minecraft/client/render/entity/MobRendererBiped.java @@ -144,7 +144,7 @@ public abstract class MobRendererBiped extends MobRenderer { GLRenderer.pushFrame(); if (itemHolder.isLeftHanded()) { if (model != null) model.translateToBone("leftItem"); - GLRenderer.modelM4f().scale(-1, 1, -1); + GLRenderer.modelM4f().scale(1, 1, -1); GLRenderer.modelM4f().scale(MobRenderer.ENTITY_RENDER_SCALE, MobRenderer.ENTITY_RENDER_SCALE, MobRenderer.ENTITY_RENDER_SCALE); ItemModelDispatcher.getInstance().getDispatch(itemstack) .render(tessellator, entity, itemstack, DisplayPos.THIRD_PERSON_LEFT_HAND, true, 1, GLRenderer.getLightIndex(), partialTick, true); diff --git a/game/client/src/main/java/net/minecraft/client/render/entity/MobRendererBipedArmored.java b/game/client/src/main/java/net/minecraft/client/render/entity/MobRendererBipedArmored.java index 603b04801..c177b3078 100644 --- a/game/client/src/main/java/net/minecraft/client/render/entity/MobRendererBipedArmored.java +++ b/game/client/src/main/java/net/minecraft/client/render/entity/MobRendererBipedArmored.java @@ -108,7 +108,7 @@ public abstract class MobRendererBipedArmored @Override public void updateTick(final @NotNull World world, final @NotNull TilePosc tilePos, final @NotNull Random rand, final boolean isRandomTick) { - this.logic.updateTick(world, tilePos, rand, false); + this.logic.updateTick(world, tilePos, rand, isRandomTick); } @Override diff --git a/game/core/src/main/java/net/minecraft/core/block/BlockLogicMushroom.java b/game/core/src/main/java/net/minecraft/core/block/BlockLogicMushroom.java index efe3b95a1..ab6f3dd1c 100644 --- a/game/core/src/main/java/net/minecraft/core/block/BlockLogicMushroom.java +++ b/game/core/src/main/java/net/minecraft/core/block/BlockLogicMushroom.java @@ -24,9 +24,9 @@ public class BlockLogicMushroom extends BlockLogicFlower { public void updateTick(@NotNull World world, @NotNull TilePosc tilePos, @NotNull Random rand, boolean isRandomTick) { if (rand.nextInt(25) == 0) { TilePos checkPos = tilePos.add(rand.nextInt(3) - 1, rand.nextInt(2) - rand.nextInt(2), rand.nextInt(3) - 1, new TilePos()); - if (world.isAirBlock(checkPos) && canStay(world, checkPos)) { + if (world.isAirBlock(checkPos) && canGrowOn(world, checkPos)) { checkPos.set(tilePos.x() + rand.nextInt(3) - 1, checkPos.y, tilePos.z() + rand.nextInt(3) - 1); - if (world.isAirBlock(checkPos) && canStay(world, checkPos)) { + if (world.isAirBlock(checkPos) && canGrowOn(world, checkPos)) { world.setBlockTypeNotify(checkPos, this.block); } } @@ -40,6 +40,10 @@ public class BlockLogicMushroom extends BlockLogicFlower { @Override public boolean canStay(@NotNull World world, @NotNull TilePosc tilePos) { + return mayPlaceOn(world.getBlockType(tilePos.down(new TilePos()))); + } + + public boolean canGrowOn(@NotNull World world, @NotNull TilePosc tilePos) { if (tilePos.y() < 0 || tilePos.y() >= world.getHeightBlocks()) { return false; } else { diff --git a/game/core/src/main/java/net/minecraft/core/block/BlockLogicRubyglassCrystal.java b/game/core/src/main/java/net/minecraft/core/block/BlockLogicRubyglassCrystal.java index 7499cab16..514fced4c 100644 --- a/game/core/src/main/java/net/minecraft/core/block/BlockLogicRubyglassCrystal.java +++ b/game/core/src/main/java/net/minecraft/core/block/BlockLogicRubyglassCrystal.java @@ -3,20 +3,25 @@ package net.minecraft.core.block; import net.minecraft.core.block.entity.TileEntity; import net.minecraft.core.block.material.Materials; import net.minecraft.core.entity.Entity; +import net.minecraft.core.entity.Mob; import net.minecraft.core.enums.EnumDropCause; import net.minecraft.core.item.ItemStack; import net.minecraft.core.util.helper.Direction; import net.minecraft.core.world.Dimension; +import net.minecraft.core.world.LevelListener; import net.minecraft.core.world.World; import net.minecraft.core.world.WorldSource; import net.minecraft.core.world.pos.TilePos; import net.minecraft.core.world.pos.TilePosc; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import org.joml.primitives.AABBd; +import org.joml.primitives.AABBdc; import java.util.Random; public class BlockLogicRubyglassCrystal extends BlockLogicTransparent { + private final @NotNull AABBd checkAABB = new AABBd(); public BlockLogicRubyglassCrystal(@NotNull Block block) { super(block, Materials.ICE); block.friction = 0.98F; @@ -35,13 +40,7 @@ public class BlockLogicRubyglassCrystal extends BlockLogicTransparent { if (world.isClientSide) return; int data = world.getBlockData(tilePos); - int nextData = data + 1; - - if (nextData >= 3) { - world.setBlockType(tilePos, Blocks.AIR); - } else { - world.setBlockDataNotify(tilePos, nextData); - } + if (data == 0) world.scheduleBlockUpdate(tilePos, this.block, tickDelay()); } @Override @@ -56,19 +55,54 @@ public class BlockLogicRubyglassCrystal extends BlockLogicTransparent { @Override public void updateTick(@NotNull World world, @NotNull TilePosc tilePos, @NotNull Random rand, boolean isRandomTick) { - if (!world.isClientSide && world.dimension == Dimension.NETHER && rand.nextInt(10) == 0) { - int dir = rand.nextInt(6); - Direction direction = Direction.fromId(dir); - TilePos checkPos = tilePos.add(direction, new TilePos()); - Block checkBlock = world.getBlockType(checkPos); - if (checkBlock == Blocks.AIR) { - world.spawnParticle("rubyglassLightning", tilePos.x(), tilePos.y(), tilePos.z(), 0.0F, 0.0F, 0.0F, dir, 1600.0F, true); + if (isRandomTick) { + if (!world.isClientSide && world.dimension == Dimension.NETHER && rand.nextInt(10) == 0) { + int dir = rand.nextInt(6); + Direction direction = Direction.fromId(dir); + TilePos checkPos = tilePos.add(direction, new TilePos()); + Block checkBlock = world.getBlockType(checkPos); + if (checkBlock == Blocks.AIR) { + world.spawnParticle("rubyglassLightning", tilePos.x(), tilePos.y(), tilePos.z(), 0.0F, 0.0F, 0.0F, dir, 1600.0F, true); + } + } + } else { + var standing = world.getEntitiesWithinAABB(Mob.class, this.checkAABB + .setMin(tilePos.x(), tilePos.y() + 1, tilePos.z()) + .setMax(tilePos.x() + 1, tilePos.y() + 1.25, tilePos.z() + 1)); + + int data = world.getBlockData(tilePos); + if (!standing.isEmpty()) { + int nextData = data + 1; + if (nextData >= 3) { + world.playBlockEvent(null, tilePos, LevelListener.EVENT_BLOCK_BREAK, block.id()); + world.setBlockTypeNotify(tilePos, Blocks.AIR); + } else { + world.setBlockDataNotify(tilePos, nextData); + world.scheduleBlockUpdate(tilePos, this.block, tickDelay()); + } + } else { + int nextData = data - 1; + if (nextData >= 0) { + world.setBlockDataNotify(tilePos, nextData); + if (nextData != 0) world.scheduleBlockUpdate(tilePos, this.block, tickDelay()); + } } } } + @Override + public @Nullable AABBdc getCollisionAABB(@NotNull WorldSource source, @NotNull TilePosc tilePos) { + double f = 0.25/16d; // TODO making the hitbox slightly shorter so `onEntityWalkedOn` triggers consistently, need a method that actually reliably is called when walked on or touched `onEntityWalkedOn` is only applied when its the block responsible for footstep noises and `onEntityWalkedOn` only happens consistently when intersecting the bounds of a block + return new AABBd(tilePos.x(), tilePos.y(), tilePos.z(), tilePos.x() + 1, tilePos.y() + 1 - f, tilePos.z() + 1); + } + @Override public int getPistonPushReaction(@NotNull World world, @NotNull TilePosc tilePos) { return 0; } + + @Override + public int tickDelay() { + return 5; + } } diff --git a/game/core/src/main/java/net/minecraft/core/block/entity/TileEntityBasket.java b/game/core/src/main/java/net/minecraft/core/block/entity/TileEntityBasket.java index 18d335387..424111057 100644 --- a/game/core/src/main/java/net/minecraft/core/block/entity/TileEntityBasket.java +++ b/game/core/src/main/java/net/minecraft/core/block/entity/TileEntityBasket.java @@ -4,15 +4,18 @@ import java.util.*; import it.unimi.dsi.fastutil.objects.Object2IntArrayMap; import it.unimi.dsi.fastutil.objects.Object2IntMap; +import net.minecraft.core.Global; import net.minecraft.core.entity.Entity; import net.minecraft.core.entity.EntityItem; import net.minecraft.core.entity.player.Player; import net.minecraft.core.item.Item; +import net.minecraft.core.item.ItemBucket; import net.minecraft.core.item.ItemStack; import com.mojang.nbt.tags.CompoundTag; import com.mojang.nbt.tags.ListTag; import net.minecraft.core.net.packet.Packet; import net.minecraft.core.net.packet.PacketTileEntityData; +import net.minecraft.core.util.collection.NamespaceID; import net.minecraft.core.world.ICarriable; import net.minecraft.core.world.ICarrySource; import net.minecraft.core.world.World; @@ -239,16 +242,49 @@ public class TileEntityBasket extends TileEntity implements ICarrySource { private record BasketEntry(int id, int metadata, CompoundTag tag) { - public static @NotNull BasketEntry read(final @NotNull CompoundTag tag) { + public static @NotNull BasketEntry read(final @NotNull CompoundTag tag) { // TODO route through future itemstack version conversion process + int version = tag.getIntegerOrDefault("Version", 0); - final int id = tag.getShort("id"); - final int damage = tag.getShort("Damage"); - final CompoundTag data = tag.getCompound("Data"); + int id = tag.getShort("id"); + int damage = tag.getShort("Damage"); + CompoundTag data = tag.getCompound("Data"); + + if (version < 19135) { + NamespaceID newState = null; + + short ironBucketId = 16562; + + if (id == 16453) { + id = ironBucketId; + } + else if (id == 16454) { // Legacy Water + id = ironBucketId; + newState = ItemBucket.STATE_WATER; + } + else if (id == 16455) { // Legacy Lava + id = ironBucketId; + newState = ItemBucket.STATE_LAVA; + } + else if (id == 16463) { // Legacy Milk + id = ironBucketId; + newState = ItemBucket.STATE_MILK; + } + else if (id == 16516) { // Legacy Ice Cream + id = ironBucketId; + newState = ItemBucket.STATE_ICECREAM; + } + + if (newState != null) { + data.putString("State", newState.toString()); + data.putInt("Charges", 1); + } + } return new BasketEntry(id, damage, data); } public static void write(final @NotNull CompoundTag tag, final @NotNull BasketEntry entry) { + tag.putInt("Version", Global.CURRENT_SAVE_VERSION); tag.putShort("id", (short) entry.id); tag.putShort("Damage", (short) entry.metadata); tag.putCompound("Data", entry.tag); diff --git a/game/core/src/main/java/net/minecraft/core/entity/monster/MobGhast.java b/game/core/src/main/java/net/minecraft/core/entity/monster/MobGhast.java index 515df1f98..fffb18866 100644 --- a/game/core/src/main/java/net/minecraft/core/entity/monster/MobGhast.java +++ b/game/core/src/main/java/net/minecraft/core/entity/monster/MobGhast.java @@ -137,7 +137,7 @@ public class MobGhast extends MobFlying implements Enemy { double maxAttackDist = 64.0D; if (this.targetedEntity != null && this.targetedEntity.distanceToSqr(this) < maxAttackDist * maxAttackDist) { double tx = this.targetedEntity.x - this.x; - double ty = (this.targetedEntity.bb.minY + (double)(this.targetedEntity.bbHeight / 2.0F)) - (this.y + (double)(this.bbHeight / 2.0F)); + double ty = (this.targetedEntity.y + this.targetedEntity.bbHeight/2f) - (this.y + this.bbHeight/2f); double tz = this.targetedEntity.z - this.z; // Calculate where we WANT to look @@ -159,6 +159,7 @@ public class MobGhast extends MobFlying implements Enemy { if (this.attackCharge == 20) { this.world.playSoundAtEntity(null, this, "mob.ghast.fireball", getSoundVolume(), (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F); ProjectileFireball fireball = new ProjectileFireball(this.world, this, tx, ty, tz); + fireball.setPos(this.x, this.y + this.bbHeight/2f, this.z); this.world.entityJoinedWorld(fireball); this.attackCharge = -40; } diff --git a/game/core/src/main/java/net/minecraft/core/item/ItemStack.java b/game/core/src/main/java/net/minecraft/core/item/ItemStack.java index 25f9f74e9..d8e53be79 100644 --- a/game/core/src/main/java/net/minecraft/core/item/ItemStack.java +++ b/game/core/src/main/java/net/minecraft/core/item/ItemStack.java @@ -10,6 +10,7 @@ import net.minecraft.core.entity.Mob; import net.minecraft.core.entity.player.Player; import net.minecraft.core.net.command.TextFormatting; import net.minecraft.core.player.inventory.container.Container; +import net.minecraft.core.util.collection.NamespaceID; import net.minecraft.core.util.helper.Side; import net.minecraft.core.world.World; import net.minecraft.core.world.pos.TilePos; @@ -160,7 +161,7 @@ public final class ItemStack { this.stackSize = nbt.getByte("Count"); this.metadata = nbt.getShort("Damage"); byte expanded = nbt.getByte("Expanded"); - int version = nbt.getInteger("Version"); + int version = nbt.getIntegerOrDefault("Version", 0); if(expanded == 0 && this.itemID >= 256) { this.itemID += (Blocks.blocksList.length - 256); @@ -173,11 +174,15 @@ public final class ItemStack { this.itemID = id[0]; this.metadata = meta[0]; } - + this.tag = nbt.getCompound("Data"); if(this.tag == null) { this.tag = Item.itemsList[this.itemID].getDefaultTag(); } + if (version < 19135) { // TODO create proper itemstack conversion process + conversionLegacyBuckets(); + } + // overrideName and overrideColor are needed, otherwise every item created in 1.7.6 (?) will turn black. if(this.tag.containsKey("color") && !this.tag.getBoolean("overrideColor")) { this.tag.getValue().remove("color"); @@ -206,6 +211,37 @@ public final class ItemStack { if(this.itemID == Blocks.CHEST_LEGACY_PAINTED.id()) this.itemID = Blocks.CHEST_PLANKS_OAK_PAINTED.id(); } + private void conversionLegacyBuckets() { + NamespaceID newState = null; + + final short ironBucketId = 16562; + + if (this.itemID == 16453) { + this.itemID = ironBucketId; + } + else if (this.itemID == 16454) { // Legacy Water + this.itemID = ironBucketId; + newState = ItemBucket.STATE_WATER; + } + else if (this.itemID == 16455) { // Legacy Lava + this.itemID = ironBucketId; + newState = ItemBucket.STATE_LAVA; + } + else if (this.itemID == 16463) { // Legacy Milk + this.itemID = ironBucketId; + newState = ItemBucket.STATE_MILK; + } + else if (this.itemID == 16516) { // Legacy Ice Cream + this.itemID = ironBucketId; + newState = ItemBucket.STATE_ICECREAM; + } + + if (newState != null) { + this.tag.putString("State", newState.toString()); + this.tag.putInt("Charges", 1); + } + } + public int getMaxStackSize() { return getItem().getItemStackLimit(this); } diff --git a/game/core/src/main/java/net/minecraft/core/world/save/SaveConverters.java b/game/core/src/main/java/net/minecraft/core/world/save/SaveConverters.java index 63fa84e98..5e483f259 100644 --- a/game/core/src/main/java/net/minecraft/core/world/save/SaveConverters.java +++ b/game/core/src/main/java/net/minecraft/core/world/save/SaveConverters.java @@ -3,7 +3,6 @@ package net.minecraft.core.world.save; import net.minecraft.core.world.save.conversion.SaveConverter19132To19133; import net.minecraft.core.world.save.conversion.SaveConverter19133To19134; import net.minecraft.core.world.save.conversion.SaveConverter19134To19135; -import net.minecraft.core.world.save.conversion.SaveConverter19135To19136; import net.minecraft.core.world.save.conversion.SaveConverterLegacyTo19132; import java.util.ArrayList; @@ -21,6 +20,5 @@ public class SaveConverters saveConverters.add(new SaveConverter19132To19133()); saveConverters.add(new SaveConverter19133To19134()); saveConverters.add(new SaveConverter19134To19135()); - saveConverters.add(new SaveConverter19135To19136()); } } diff --git a/game/core/src/main/java/net/minecraft/core/world/save/SaveFormats.java b/game/core/src/main/java/net/minecraft/core/world/save/SaveFormats.java index 30474c051..1f1e858c1 100644 --- a/game/core/src/main/java/net/minecraft/core/world/save/SaveFormats.java +++ b/game/core/src/main/java/net/minecraft/core/world/save/SaveFormats.java @@ -8,7 +8,6 @@ import net.minecraft.core.world.save.mcregion.SaveFormat19132; import net.minecraft.core.world.save.mcregion.SaveFormat19133; import net.minecraft.core.world.save.mcregion.SaveFormat19134; import net.minecraft.core.world.save.mcregion.SaveFormat19135; -import net.minecraft.core.world.save.mcregion.SaveFormat19136; import org.slf4j.Logger; import java.io.File; @@ -36,6 +35,5 @@ public class SaveFormats saveFormats.put(19133, SaveFormat19133.class); saveFormats.put(19134, SaveFormat19134.class); saveFormats.put(19135, SaveFormat19135.class); - saveFormats.put(19136, SaveFormat19136.class); } } diff --git a/game/core/src/main/java/net/minecraft/core/world/save/conversion/SaveConverter19134To19135.java b/game/core/src/main/java/net/minecraft/core/world/save/conversion/SaveConverter19134To19135.java index 6cc279245..2ac101491 100644 --- a/game/core/src/main/java/net/minecraft/core/world/save/conversion/SaveConverter19134To19135.java +++ b/game/core/src/main/java/net/minecraft/core/world/save/conversion/SaveConverter19134To19135.java @@ -32,8 +32,12 @@ public class SaveConverter19134To19135 extends SaveConverterMCRegionBase{ @Override int convertDimensionRegions(@NotNull Dimension dimension, @NotNull ArrayList regionFiles, int conversionsPerformed, int totalConversions, @NotNull ProgressListener progress) { + int progressValue = 0; + int conversions = 0; if (dimension == Dimension.NETHER) { for (int ri = 0, regionFilesSize = regionFiles.size(); ri < regionFilesSize; ri++) { + progress.progressStagePercentage(progressValue); + File region = regionFiles.get(ri); RegionFile regionFile = new RegionFile(region); @@ -145,9 +149,12 @@ public class SaveConverter19134To19135 extends SaveConverterMCRegionBase{ } } } + + conversions++; + progressValue = (int)Math.round((100D * (double)(conversionsPerformed + conversions)) / (double)totalConversions); } } - return 0; + return conversions; } private @Nullable CompoundTag convertSection(@NotNull CompoundTag oldSection) { diff --git a/game/core/src/main/java/net/minecraft/core/world/save/conversion/SaveConverter19135To19136.java b/game/core/src/main/java/net/minecraft/core/world/save/conversion/SaveConverter19135To19136.java deleted file mode 100644 index a4b00e865..000000000 --- a/game/core/src/main/java/net/minecraft/core/world/save/conversion/SaveConverter19135To19136.java +++ /dev/null @@ -1,136 +0,0 @@ -package net.minecraft.core.world.save.conversion; - -import com.mojang.logging.LogUtils; -import com.mojang.nbt.NbtIo; -import com.mojang.nbt.tags.CompoundTag; -import com.mojang.nbt.tags.ListTag; -import com.mojang.nbt.tags.Tag; -import net.minecraft.core.world.Dimension; -import net.minecraft.core.world.ProgressListener; -import net.minecraft.core.world.save.mcregion.RegionFile; -import net.minecraft.core.world.save.mcregion.RegionFileCache; -import org.jetbrains.annotations.NotNull; -import org.slf4j.Logger; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; -import java.util.ArrayList; -import java.util.Collections; - - -//Legacy Bucket Conversion (8.0) -public class SaveConverter19135To19136 extends SaveConverterMCRegionBase { - private static final Logger LOGGER = LogUtils.getLogger(); - - @Override - public int fromVersion() { - return 19135; - } - - @Override - public int toVersion() { - return 19136; - } - - @Override - public void convertSave(@NotNull CompoundTag levelData, @NotNull File savesDir, @NotNull String worldDirName, @NotNull ProgressListener progress) { - convertBasketTileEntities(levelData); - ItemConverters.legacyBucketConverterRecursive(levelData); - convertPlayerDataFiles(savesDir, worldDirName); - super.convertSave(levelData, savesDir, worldDirName, progress); - } - - @Override - int convertDimensionRegions(@NotNull Dimension dimension, @NotNull ArrayList regionFiles, int conversionsPerformed, int totalConversions, @NotNull ProgressListener progress) { - Collections.sort(regionFiles); - int progressValue = 0; - int conversions = 0; - - for (File region : regionFiles) { - progress.progressStagePercentage(progressValue); - - RegionFile regionFile = new RegionFile(region); - - for (int x = 0; x < 32; x++) { - for (int z = 0; z < 32; z++) { - try { - DataInputStream inputStream = regionFile.getChunkDataInputStream(x, z); - if (inputStream == null) continue; - DataOutputStream outputStream = regionFile.getChunkDataOutputStream(x, z); - CompoundTag chunkData = NbtIo.read(inputStream); - - convertBasketTileEntities(chunkData); - ItemConverters.legacyBucketConverterRecursive(chunkData); - NbtIo.write(chunkData, outputStream); - - inputStream.close(); - outputStream.close(); - } catch (IOException e) { - LOGGER.error("Failed to convert chunk X:{}, Z:{}, in region {}!", x, z, region.toPath(), e); - } - } - } - - conversions++; - progressValue = (int) Math.round((100D * (double) (conversionsPerformed + conversions)) / (double) totalConversions); - } - - RegionFileCache.flushCache(); - - return conversions; - } - - private static void convertBasketTileEntities(@NotNull CompoundTag rootTag) { - CompoundTag levelTag = rootTag.getCompoundOrDefault("Level", null); - if (levelTag == null) { - return; - } - - ListTag tileEntities = levelTag.getListOrDefault("TileEntities", null); - if (tileEntities == null) { - return; - } - - for (Tag tag : tileEntities) { - if (!(tag instanceof CompoundTag tileEntityTag)) { - continue; - } - String id = tileEntityTag.getString("id"); - if (!"minecraft:basket".equals(id) && !"Basket".equals(id)) { - continue; - } - - ListTag itemsTag = tileEntityTag.getListOrDefault("Items", null); - if (itemsTag == null) { - continue; - } - - for (Tag itemTag : itemsTag) { - if (itemTag instanceof CompoundTag itemCompound) { - ItemConverters.legacyBucketConverter(itemCompound); - } - } - } - } - - private void convertPlayerDataFiles(@NotNull File savesDir, @NotNull String worldDirName) { - File playersDir = new File(new File(savesDir, worldDirName), "players"); - File[] playerFiles = playersDir.listFiles((dir, name) -> name.endsWith(".dat")); - if (playerFiles == null) { - return; - } - - for (File playerFile : playerFiles) { - try { - CompoundTag playerData = NbtIo.readCompressed(Files.newInputStream(playerFile.toPath())); - ItemConverters.legacyBucketConverterRecursive(playerData); - NbtIo.writeCompressed(playerData, Files.newOutputStream(playerFile.toPath())); - } catch (IOException e) { - LOGGER.error("Failed to convert player data file '{}' for world '{}'!", playerFile.getName(), worldDirName, e); - } - } - } -} diff --git a/game/core/src/main/java/net/minecraft/core/world/save/mcregion/SaveFormat19136.java b/game/core/src/main/java/net/minecraft/core/world/save/mcregion/SaveFormat19136.java deleted file mode 100644 index cc9dd93fb..000000000 --- a/game/core/src/main/java/net/minecraft/core/world/save/mcregion/SaveFormat19136.java +++ /dev/null @@ -1,39 +0,0 @@ -package net.minecraft.core.world.save.mcregion; - -import net.minecraft.core.world.Dimension; -import net.minecraft.core.world.save.SaveFormatBase; - -import java.io.File; - -public class SaveFormat19136 extends SaveFormatBase { - public SaveFormat19136(File savesDir) { - super(savesDir); - } - - @Override - public String getFormatName() { - return "BTARegion"; - } - - @Override - public String getFormatMessage(){ return "Converting Legacy Buckets...";} - - @Override - public int getSaveVersion() { - return 19136; - } - - @Override - public void flushCache() { - RegionFileCache.flushCache(); - } - - @Override - public File getDimensionRootDir(String worldDirName, Dimension dimension) { - File worldDir = new File(savesDir, worldDirName); - - File worldDimsDir = new File(worldDir, "dimensions"); - - return new File(worldDimsDir, Integer.toString(dimension.id)); - } -} diff --git a/util/nbt/src/main/java/com/mojang/nbt/tags/CompoundTag.java b/util/nbt/src/main/java/com/mojang/nbt/tags/CompoundTag.java index bac09bd55..88423f99e 100644 --- a/util/nbt/src/main/java/com/mojang/nbt/tags/CompoundTag.java +++ b/util/nbt/src/main/java/com/mojang/nbt/tags/CompoundTag.java @@ -359,7 +359,7 @@ public class CompoundTag extends Tag<@NotNull Map>> return getCompoundOrDefault(key, new CompoundTag()); } - public @Nullable CompoundTag getCompoundOrDefault(@NotNull String key, @Nullable CompoundTag defaultCompound) + public CompoundTag getCompoundOrDefault(@NotNull String key, @Nullable CompoundTag defaultCompound) { Tag tag = getTagOrDefault(key, null); @@ -375,7 +375,7 @@ public class CompoundTag extends Tag<@NotNull Map>> put(key, compound); } - public ListTag getList(String key) + public @NotNull ListTag getList(String key) { return getListOrDefault(key, new ListTag()); }