mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-17 02:45:13 +00:00
Fix a lot of stairs, make ender eye block particles clientside to reduce network traffic
This commit is contained in:
1 parent
f1288aba3a
commit
fa983f1638
66 files changed
+949
-733
No files matched your search
@@ -17,6 +17,7 @@ import net.minecraft.block.state.BlockFaceShape;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.particles.RedstoneParticleData;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
@@ -31,6 +32,7 @@ import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockEnderEye extends BlockMod implements ILexiconable {
|
||||
|
||||
@@ -76,4 +78,16 @@ public class BlockEnderEye extends BlockMod implements ILexiconable {
|
||||
return BlockFaceShape.UNDEFINED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void animateTick(IBlockState state, World world, BlockPos pos, Random rand) {
|
||||
if(state.get(BotaniaStateProps.POWERED)) {
|
||||
for(int i = 0; i < 20; i++) {
|
||||
double x = pos.getX() - 0.1 + Math.random() * 1.2;
|
||||
double y = pos.getY() - 0.1 + Math.random() * 1.2;
|
||||
double z = pos.getZ() - 0.1 + Math.random() * 1.2;
|
||||
|
||||
world.addParticle(RedstoneParticleData.REDSTONE_DUST, x, y, z, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -59,16 +59,8 @@ public class TileEnderEye extends TileMod implements ITickable {
|
||||
}
|
||||
}
|
||||
|
||||
if(looking != wasLooking && !world.isRemote)
|
||||
if(looking != wasLooking)
|
||||
world.setBlockState(getPos(), world.getBlockState(getPos()).with(BotaniaStateProps.POWERED, looking), 1 | 2);
|
||||
|
||||
if(looking) {
|
||||
double x = getPos().getX() - 0.1 + Math.random() * 1.2;
|
||||
double y = getPos().getY() - 0.1 + Math.random() * 1.2;
|
||||
double z = getPos().getZ() - 0.1 + Math.random() * 1.2;
|
||||
|
||||
((WorldServer) world).spawnParticle(RedstoneParticleData.REDSTONE_DUST, x, y, z, 0, 1.0D, 0.0D, 0.0D, 1.0D);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user