mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-20 04:09:40 +00:00
update
This commit is contained in:
1 parent
a9112a40fb
commit
e676b13e36
3 files changed
+10
-34
No files matched your search
@@ -123,10 +123,9 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector
|
||||
public static boolean staticDreamwood = false;
|
||||
public static boolean staticUltra = false;
|
||||
|
||||
UUID identity;
|
||||
|
||||
UUID identity = UUID.fromString("0d0f407d-1760-4f68-84af-3067c3ed0837");
|
||||
FakePlayer fakeplayer;
|
||||
GameProfile profile = new GameProfile(UUID.fromString("0d0f407d-1760-4f68-84af-3067c3ed0837"), "[Botania]");
|
||||
GameProfile profile = new GameProfile(identity, "[Botania]");
|
||||
private static final WeakHashMap<World, WeakReference<EntityPlayer>> FakePlayers = new WeakHashMap<>();
|
||||
|
||||
int mana;
|
||||
@@ -268,10 +267,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector
|
||||
public void writeCustomNBT(NBTTagCompound cmp) {
|
||||
super.writeCustomNBT(cmp);
|
||||
|
||||
UUID identity = getIdentifier();
|
||||
cmp.setBoolean(TAG_HAS_IDENTITY, true);
|
||||
cmp.setLong(TAG_UUID_MOST, identity.getMostSignificantBits());
|
||||
cmp.setLong(TAG_UUID_LEAST, identity.getLeastSignificantBits());
|
||||
|
||||
|
||||
cmp.setInteger(TAG_MANA, mana);
|
||||
cmp.setFloat(TAG_ROTATION_X, rotationX);
|
||||
@@ -307,13 +303,6 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector
|
||||
public void readCustomNBT(NBTTagCompound cmp) {
|
||||
super.readCustomNBT(cmp);
|
||||
|
||||
if(cmp.getBoolean(TAG_HAS_IDENTITY)) {
|
||||
long most = cmp.getLong(TAG_UUID_MOST);
|
||||
long least = cmp.getLong(TAG_UUID_LEAST);
|
||||
UUID identity = getIdentifierUnsafe();
|
||||
if(identity == null || most != identity.getMostSignificantBits() || least != identity.getLeastSignificantBits())
|
||||
identity = new UUID(most, least);
|
||||
} else getIdentifier();
|
||||
|
||||
mana = cmp.getInteger(TAG_MANA);
|
||||
rotationX = cmp.getFloat(TAG_ROTATION_X);
|
||||
@@ -764,8 +753,6 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector
|
||||
|
||||
@Override
|
||||
public UUID getIdentifier() {
|
||||
if(identity == null)
|
||||
identity = UUID.randomUUID();
|
||||
return identity;
|
||||
}
|
||||
public void setFakeplayer(){
|
||||
@@ -779,8 +766,4 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector
|
||||
}
|
||||
}
|
||||
|
||||
public UUID getIdentifierUnsafe() {
|
||||
return identity;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,13 +2,11 @@ package vazkii.botania.common.core.helper;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.BlockSnapshot;
|
||||
import net.minecraftforge.event.world.BlockEvent;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemHelper {
|
||||
public static boolean canPlaceBlock(World world, int x, int y, int z, int xAt, int yAt, int zAt, EntityPlayer player){
|
||||
@@ -21,11 +19,7 @@ public class ItemHelper {
|
||||
|
||||
return !event.isCanceled();
|
||||
}
|
||||
// public static boolean canPlaceMultiBLock(World world, List<ChunkCoordinates> list, int xAt, int yAt, int zAt, EntityPlayer player){
|
||||
//
|
||||
// Block block = world.getBlock(xAt,yAt ,zAt);
|
||||
// BlockEvent.MultiPlaceEvent event = new BlockEvent.MultiPlaceEvent(blocksnapshots,block,player);
|
||||
// }
|
||||
|
||||
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);
|
||||
|
||||
Reference in new issue
Block a user