minor corrections

This commit is contained in:
RubilaxXxx committed 2025-07-09 22:02:25 +02:00
1 parent 1e2aecb3d4
commit 14b51c05e4
4 files changed
+10 -11

No files matched your search

@@ -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<TileSpreader> implements IW
Random random;
public BlockSpreader() {
super(Material.wood);
setHardness(2.0F);
@@ -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<World, WeakReference<EntityPlayer>> 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<IManaBurst> 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<EntityPlayer> 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();
}
}
}
@@ -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;