From 14b51c05e44ce87fe017f317304fc4ae3e0e272f Mon Sep 17 00:00:00 2001 From: RubilaxXxx <162358670+RubilaxXxx@users.noreply.github.com> Date: Wed, 9 Jul 2025 22:02:25 +0200 Subject: [PATCH] minor corrections --- dependencies.gradle | 5 +++-- .../botania/common/block/mana/BlockSpreader.java | 2 -- .../botania/common/block/tile/mana/TileSpreader.java | 11 ++++------- .../vazkii/botania/common/core/helper/ItemHelper.java | 3 +++ 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index cdb57d15d..4a37fcde8 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -2,11 +2,12 @@ dependencies { api('com.github.GTNewHorizons:Baubles-Expanded:2.1.9-GTNH:dev') - api('com.github.GTNewHorizons:GTNHLib:0.6.32:dev') + api('com.github.GTNewHorizons:GTNHLib:0.6.36:dev') compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.44:api') {transitive=false} compileOnly('com.github.GTNewHorizons:ForgeMultipart:1.6.7:dev') {transitive=false} - devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.7.60-GTNH:dev') + devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.7.62-GTNH:dev') + runtimeOnlyNonPublishable('com.github.GTNewHorizons:ServerUtilities:2.1.54:dev') compileOnly('com.github.GTNewHorizons:Railcraft:9.16.30:api') {transitive=false} compileOnly('com.github.GTNewHorizons:StorageDrawers:2.1.4-GTNH:api') {transitive=false} compileOnly('curse.maven:cofh-lib-220333:2388748') diff --git a/src/main/java/vazkii/botania/common/block/mana/BlockSpreader.java b/src/main/java/vazkii/botania/common/block/mana/BlockSpreader.java index 3bd196463..de03e3525 100644 --- a/src/main/java/vazkii/botania/common/block/mana/BlockSpreader.java +++ b/src/main/java/vazkii/botania/common/block/mana/BlockSpreader.java @@ -31,7 +31,6 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.IIcon; import net.minecraft.world.World; -import net.minecraftforge.common.util.FakePlayer; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.mana.ILens; @@ -52,7 +51,6 @@ public class BlockSpreader extends BlockModContainer implements IW Random random; - public BlockSpreader() { super(Material.wood); setHardness(2.0F); diff --git a/src/main/java/vazkii/botania/common/block/tile/mana/TileSpreader.java b/src/main/java/vazkii/botania/common/block/tile/mana/TileSpreader.java index 8e7911605..e6b895a28 100644 --- a/src/main/java/vazkii/botania/common/block/tile/mana/TileSpreader.java +++ b/src/main/java/vazkii/botania/common/block/tile/mana/TileSpreader.java @@ -124,7 +124,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector public static boolean staticUltra = false; UUID identity = UUID.fromString("0d0f407d-1760-4f68-84af-3067c3ed0837"); - FakePlayer fakeplayer; + EntityPlayer fakeplayer; GameProfile profile = new GameProfile(identity, "[Botania]"); private static final WeakHashMap> FakePlayers = new WeakHashMap<>(); @@ -182,6 +182,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector ManaNetworkEvent.addCollector(this); inNetwork = true; } + boolean redstone = false; for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { @@ -219,7 +220,6 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector List bursts = worldObj.getEntitiesWithinAABB(IManaBurst.class, aabb); IManaBurst found = null; UUID identity = getIdentifier(); - for(IManaBurst burst : bursts) if(burst != null && identity.equals(burst.getShooterUIID())) { found = burst; @@ -267,8 +267,6 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector public void writeCustomNBT(NBTTagCompound cmp) { super.writeCustomNBT(cmp); - - cmp.setInteger(TAG_MANA, mana); cmp.setFloat(TAG_ROTATION_X, rotationX); cmp.setFloat(TAG_ROTATION_Y, rotationY); @@ -303,7 +301,6 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector public void readCustomNBT(NBTTagCompound cmp) { super.readCustomNBT(cmp); - mana = cmp.getInteger(TAG_MANA); rotationX = cmp.getFloat(TAG_ROTATION_X); rotationY = cmp.getFloat(TAG_ROTATION_Y); @@ -755,6 +752,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector public UUID getIdentifier() { return identity; } + public void setFakeplayer(){ if(!worldObj.isRemote) { final WeakReference playerref = FakePlayers.get(worldObj); @@ -762,8 +760,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector final FakePlayer player = FakePlayerFactory.get((WorldServer) worldObj, profile); FakePlayers.put(worldObj, new WeakReference<>(player)); this.fakeplayer = player; - } + } else fakeplayer = playerref.get(); } } - } diff --git a/src/main/java/vazkii/botania/common/core/helper/ItemHelper.java b/src/main/java/vazkii/botania/common/core/helper/ItemHelper.java index adb9c44e6..f3b3d0fe4 100644 --- a/src/main/java/vazkii/botania/common/core/helper/ItemHelper.java +++ b/src/main/java/vazkii/botania/common/core/helper/ItemHelper.java @@ -14,6 +14,7 @@ public class ItemHelper { Block blockAt= world.getBlock(xAt,zAt,yAt); int meta = world.getBlockMetadata(x,y,z); BlockSnapshot snapshot = new BlockSnapshot(world,x,y,z,block,meta); + BlockEvent.PlaceEvent event = new BlockEvent.PlaceEvent(snapshot,blockAt,player); MinecraftForge.EVENT_BUS.post(event); @@ -23,8 +24,10 @@ public class ItemHelper { public static boolean canBreakBlock(World world,int x, int y, int z,EntityPlayer player){ Block block = world.getBlock(x,y,z); int meta = world.getBlockMetadata(x,y,z); + BlockEvent.BreakEvent event = new BlockEvent.BreakEvent(x, y, z, world, block, meta, player); MinecraftForge.EVENT_BUS.post(event); + boolean canMineBlock = world.canMineBlock(player,x,y,z); return !event.isCanceled() && canMineBlock;