mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-19 19:59:36 +00:00
Global safety checks for blockstates while chunks are unloading
This commit is contained in:
1 parent
84204db587
commit
f3cce3d24e
54 files changed
+163
-114
No files matched your search
@@ -180,12 +180,15 @@ public class ClientProxy extends CommonProxy {
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(MiscellaneousIcons.INSTANCE);
|
||||
ModelHandler.registerModels();
|
||||
initRenderers();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
super.init(event);
|
||||
|
||||
initAuxiliaryRender();
|
||||
|
||||
ModChallenges.init();
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(new ClientTickHandler());
|
||||
@@ -214,7 +217,6 @@ public class ClientProxy extends CommonProxy {
|
||||
dootDoot = true;
|
||||
}
|
||||
|
||||
initRenderers();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -270,7 +272,9 @@ public class ClientProxy extends CommonProxy {
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityEnderAirBottle.class, renderManager -> new RenderSnowballStack(renderManager, new ItemStack(ModItems.manaResource, 1, 15), Minecraft.getMinecraft().getRenderItem()));
|
||||
|
||||
ShaderHelper.initShaders();
|
||||
}
|
||||
|
||||
private void initAuxiliaryRender() {
|
||||
Map<String, RenderPlayer> skinMap = Minecraft.getMinecraft().getRenderManager().getSkinMap();
|
||||
RenderPlayer render = skinMap.get("default");
|
||||
render.addLayer(new ContributorFancinessHandler());
|
||||
|
||||
@@ -31,13 +31,12 @@ public class RenderTileAlfPortal extends TileEntitySpecialRenderer<TileAlfPortal
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileAlfPortal portal, double d0, double d1, double d2, float f, int digProgress) {
|
||||
AlfPortalState state;
|
||||
if (portal.getWorld().getBlockState(portal.getPos()).getBlock() != ModBlocks.alfPortal) {
|
||||
state = AlfPortalState.OFF;
|
||||
} else {
|
||||
state = portal.getWorld().getBlockState(portal.getPos()).getValue(BotaniaStateProps.ALFPORTAL_STATE);
|
||||
if (portal != null && portal.getWorld() != null && !portal.getWorld().isBlockLoaded(portal.getPos(), false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
AlfPortalState state = portal.getWorld().getBlockState(portal.getPos()).getValue(BotaniaStateProps.ALFPORTAL_STATE);
|
||||
|
||||
if(state == AlfPortalState.OFF)
|
||||
return;
|
||||
|
||||
|
||||
@@ -51,6 +51,10 @@ public class RenderTileAltar extends TileEntitySpecialRenderer<TileAltar> {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileAltar altar, double d0, double d1, double d2, float pticks, int digProgress) {
|
||||
if (altar != null && altar.getWorld() != null && !altar.getWorld().isBlockLoaded(altar.getPos(), false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
|
||||
@@ -17,11 +17,13 @@ import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.api.item.IAvatarWieldable;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.model.ModelAvatar;
|
||||
@@ -38,17 +40,23 @@ public class RenderTileAvatar extends TileEntitySpecialRenderer<TileAvatar> {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileAvatar avatar, double d0, double d1, double d2, float pticks, int digProgress) {
|
||||
if (avatar != null && avatar.getWorld() != null && !avatar.getWorld().isBlockLoaded(avatar.getPos(), false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
GlStateManager.translate(d0, d1, d2);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
|
||||
int meta = avatar != null && avatar.getWorld() != null ? avatar.getBlockMetadata() : 0;
|
||||
EnumFacing facing = avatar != null && avatar.getWorld() != null
|
||||
? avatar.getWorld().getBlockState(avatar.getPos()).getValue(BotaniaStateProps.CARDINALS)
|
||||
: EnumFacing.SOUTH;
|
||||
|
||||
GlStateManager.translate(0.5F, 1.6F, 0.5F);
|
||||
GlStateManager.scale(1F, -1F, -1F);
|
||||
GlStateManager.rotate(ROTATIONS[Math.max(Math.min(ROTATIONS.length - 1, meta - 2), 0)], 0F, 1F, 0F);
|
||||
GlStateManager.rotate(ROTATIONS[Math.max(Math.min(ROTATIONS.length - 1, facing.getIndex() - 2), 0)], 0F, 1F, 0F);
|
||||
model.render();
|
||||
|
||||
if (avatar == null) {
|
||||
|
||||
@@ -30,6 +30,10 @@ public class RenderTileBellows extends TileEntitySpecialRenderer<TileBellows> {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileBellows bellows, double d0, double d1, double d2, float f, int digProgress) {
|
||||
if (bellows != null && bellows.getWorld() != null && !bellows.getWorld().isBlockLoaded(bellows.getPos(), false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
|
||||
@@ -32,6 +32,10 @@ public class RenderTileFloatingFlower extends TileEntitySpecialRenderer {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tile, double d0, double d1, double d2, float t, int digProgress) {
|
||||
if (tile != null && tile.getWorld() != null && !tile.getWorld().isBlockLoaded(tile.getPos(), false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
BlockRendererDispatcher brd = Minecraft.getMinecraft().getBlockRendererDispatcher();
|
||||
IFloatingFlower flower = (IFloatingFlower) tile;
|
||||
GlStateManager.pushMatrix();
|
||||
|
||||
@@ -37,7 +37,11 @@ public class RenderTileIncensePlate extends TileEntitySpecialRenderer<TileIncens
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileIncensePlate plate, double d0, double d1, double d2, float ticks, int digProgress) {
|
||||
EnumFacing facing = plate.getWorld() != null ? plate.getWorld().getBlockState(plate.getPos()).getValue(BotaniaStateProps.CARDINALS) : EnumFacing.SOUTH;
|
||||
if (plate != null && plate.getWorld() != null && !plate.getWorld().isBlockLoaded(plate.getPos(), false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
EnumFacing facing = plate.getWorld().getBlockState(plate.getPos()).getValue(BotaniaStateProps.CARDINALS);
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableRescaleNormal();
|
||||
|
||||
@@ -29,6 +29,10 @@ public class RenderTileLightRelay extends TileEntitySpecialRenderer<TileLightRel
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileLightRelay tile, double x, double y, double z, float pticks, int digProgress) {
|
||||
if (tile != null && tile.getWorld() != null && !tile.getWorld().isBlockLoaded(tile.getPos(), false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
TextureAtlasSprite iicon = tile.getBlockMetadata() > 0 ? MiscellaneousIcons.INSTANCE.lightRelayWorldIconRed : MiscellaneousIcons.INSTANCE.lightRelayWorldIcon;
|
||||
|
||||
|
||||
@@ -52,6 +52,10 @@ public class RenderTilePool extends TileEntitySpecialRenderer<TilePool> {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TilePool pool, double d0, double d1, double d2, float f, int digProgress) {
|
||||
if (pool != null && pool.getWorld() != null && !pool.getWorld().isBlockLoaded(pool.getPos(), false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
@@ -92,6 +96,8 @@ public class RenderTilePool extends TileEntitySpecialRenderer<TilePool> {
|
||||
|
||||
tess.draw();
|
||||
|
||||
GlStateManager.enableLighting();
|
||||
|
||||
GlStateManager.translate(0.5F, 1.5F, 0.5F);
|
||||
GlStateManager.color(1, 1, 1, a);
|
||||
GlStateManager.enableRescaleNormal();
|
||||
|
||||
@@ -13,8 +13,10 @@ package vazkii.botania.client.render.tile;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.model.ModelPump;
|
||||
import vazkii.botania.common.block.tile.mana.TilePump;
|
||||
@@ -30,17 +32,21 @@ public class RenderTilePump extends TileEntitySpecialRenderer<TilePump> {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TilePump pump, double d0, double d1, double d2, float f, int digProgress) {
|
||||
if (pump != null && pump.getWorld() != null && !pump.getWorld().isBlockLoaded(pump.getPos(), false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
GlStateManager.translate(d0, d1, d2);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
|
||||
int meta = pump != null && pump.getWorld() != null ? pump.getBlockMetadata() : 0;
|
||||
EnumFacing facing = pump != null && pump.getWorld() != null ? pump.getWorld().getBlockState(pump.getPos()).getValue(BotaniaStateProps.CARDINALS) : EnumFacing.SOUTH;
|
||||
|
||||
GlStateManager.translate(0.5F, 0.5F, 0.5F);
|
||||
GlStateManager.scale(1F, -1F, -1F);
|
||||
GlStateManager.rotate(ROTATIONS[Math.max(Math.min(ROTATIONS.length - 1, meta - 2), 0)], 0F, 1F, 0F);
|
||||
GlStateManager.rotate(ROTATIONS[Math.max(Math.min(ROTATIONS.length - 1, facing.getIndex() - 2), 0)], 0F, 1F, 0F);
|
||||
model.render(Math.max(0F, Math.min(8F, pump == null ? 8 : pump.innerRingPos + pump.moving * f)));
|
||||
GlStateManager.color(1F, 1F, 1F);
|
||||
GlStateManager.scale(1F, -1F, -1F);
|
||||
|
||||
@@ -51,6 +51,10 @@ public class RenderTilePylon extends TileEntitySpecialRenderer<TilePylon> {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TilePylon pylon, double d0, double d1, double d2, float pticks, int digProgress) {
|
||||
if (pylon != null && pylon.getWorld() != null && !pylon.getWorld().isBlockLoaded(pylon.getPos(), false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(model == null)
|
||||
model = ConfigHandler.oldPylonModel ? new ModelPylonOld() : new ModelPylon();
|
||||
|
||||
|
||||
@@ -46,6 +46,10 @@ public class RenderTileSpreader extends TileEntitySpecialRenderer<TileSpreader>
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileSpreader spreader, double d0, double d1, double d2, float ticks, int digProgress) {
|
||||
if (spreader != null && spreader.getWorld() != null && !spreader.getWorld().isBlockLoaded(spreader.getPos(), false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
|
||||
@@ -50,6 +50,10 @@ public class RenderTileTinyPotato extends TileEntitySpecialRenderer<TileTinyPota
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileTinyPotato potato, double d0, double d1, double d2, float var8, int digProgress) {
|
||||
if (potato != null && potato.getWorld() != null && !potato.getWorld().isBlockLoaded(potato.getPos(), false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
|
||||
@@ -45,7 +45,7 @@ import vazkii.botania.common.lexicon.LexiconData;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
|
||||
public class TileAlfPortal extends TileMod implements ITickable {
|
||||
public class TileAlfPortal extends TileMod {
|
||||
|
||||
private static final BlockPos[] LIVINGWOOD_POSITIONS = {
|
||||
new BlockPos(-1, 0, 0), new BlockPos(1, 0, 0), new BlockPos(-2, 1, 0),
|
||||
@@ -109,11 +109,10 @@ public class TileAlfPortal extends TileMod implements ITickable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
public void updateEntity() {
|
||||
IBlockState iBlockState = worldObj.getBlockState(getPos());
|
||||
if(iBlockState.getBlock() != ModBlocks.alfPortal || iBlockState.getValue(BotaniaStateProps.ALFPORTAL_STATE) == AlfPortalState.OFF) {
|
||||
if (iBlockState.getBlock() == ModBlocks.alfPortal)
|
||||
ticksOpen = 0;
|
||||
if(iBlockState.getValue(BotaniaStateProps.ALFPORTAL_STATE) == AlfPortalState.OFF) {
|
||||
ticksOpen = 0;
|
||||
return;
|
||||
}
|
||||
AlfPortalState state = iBlockState.getValue(BotaniaStateProps.ALFPORTAL_STATE);
|
||||
|
||||
@@ -47,7 +47,7 @@ import vazkii.botania.client.core.helper.RenderHelper;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
public class TileAltar extends TileSimpleInventory implements ISidedInventory, IPetalApothecary, ITickable {
|
||||
public class TileAltar extends TileSimpleInventory implements ISidedInventory, IPetalApothecary {
|
||||
|
||||
private static final Pattern SEED_PATTERN = Pattern.compile("(?:(?:(?:[A-Z-_.:]|^)seed)|(?:(?:[a-z-_.:]|^)Seed))(?:[sA-Z-_.:]|$)");
|
||||
|
||||
@@ -226,7 +226,7 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory, I
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
public void updateEntity() {
|
||||
List<EntityItem> items = worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos.add(0, 1D / 16D * 20D, 0), pos.add(1, 1D / 16D * 21D,1)));
|
||||
|
||||
boolean didChange = false;
|
||||
|
||||
@@ -19,7 +19,7 @@ import vazkii.botania.api.item.IAvatarTile;
|
||||
import vazkii.botania.api.item.IAvatarWieldable;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
public class TileAvatar extends TileSimpleInventory implements IAvatarTile, ISidedInventory, ITickable {
|
||||
public class TileAvatar extends TileSimpleInventory implements IAvatarTile, ISidedInventory {
|
||||
|
||||
private static final int MAX_MANA = 6400;
|
||||
|
||||
@@ -32,8 +32,7 @@ public class TileAvatar extends TileSimpleInventory implements IAvatarTile, ISid
|
||||
int mana;
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
|
||||
public void updateEntity() {
|
||||
enabled = true;
|
||||
for(EnumFacing dir : EnumFacing.VALUES) {
|
||||
int redstoneSide = worldObj.getRedstonePower(pos.offset(dir), dir);
|
||||
|
||||
@@ -14,14 +14,14 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ITickable;
|
||||
import vazkii.botania.common.Botania;
|
||||
|
||||
public class TileBifrost extends TileMod implements ITickable {
|
||||
public class TileBifrost extends TileMod {
|
||||
|
||||
private static final String TAG_TICKS = "ticks";
|
||||
|
||||
public int ticks = 0;
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
public void updateEntity() {
|
||||
if(!worldObj.isRemote) {
|
||||
if(ticks <= 0) {
|
||||
worldObj.setBlockToAir(pos);
|
||||
|
||||
@@ -36,7 +36,7 @@ import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
// This is mostly copypasta from TileRuneAltar
|
||||
public class TileBrewery extends TileSimpleInventory implements ISidedInventory, IManaReceiver, ITickable {
|
||||
public class TileBrewery extends TileSimpleInventory implements ISidedInventory, IManaReceiver {
|
||||
|
||||
private static final String TAG_MANA = "mana";
|
||||
|
||||
@@ -80,8 +80,7 @@ public class TileBrewery extends TileSimpleInventory implements ISidedInventory,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
|
||||
public void updateEntity() {
|
||||
if(mana > 0 && recipe == null) {
|
||||
for(RecipeBrew recipe : BotaniaAPI.brewRecipes)
|
||||
if(recipe.matches(this)) {
|
||||
|
||||
@@ -24,7 +24,7 @@ import net.minecraft.entity.passive.EntityWolf;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ITickable;
|
||||
|
||||
public class TileCocoon extends TileMod implements ITickable {
|
||||
public class TileCocoon extends TileMod {
|
||||
|
||||
private static final String TAG_TIME_PASSED = "timePassed";
|
||||
private static final String TAG_EMERALDS_GIVEN = "emeraldsGiven";
|
||||
@@ -36,7 +36,7 @@ public class TileCocoon extends TileMod implements ITickable {
|
||||
public int emeraldsGiven;
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
public void updateEntity() {
|
||||
timePassed++;
|
||||
if(timePassed >= TOTAL_TIME)
|
||||
hatch();
|
||||
|
||||
@@ -91,7 +91,7 @@ public class TileCraftCrate extends TileOpenCrate {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
public void updateEntity() {
|
||||
if(!worldObj.isRemote && (craft(true) && canEject() || isFull()))
|
||||
ejectAll();
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ import vazkii.botania.client.core.helper.RenderHelper;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
|
||||
public class TileEnchanter extends TileMod implements ISparkAttachable, ITickable {
|
||||
public class TileEnchanter extends TileMod implements ISparkAttachable {
|
||||
|
||||
private static final String TAG_STAGE = "stage";
|
||||
private static final String TAG_STAGE_TICKS = "stageTicks";
|
||||
@@ -133,10 +133,8 @@ public class TileEnchanter extends TileMod implements ISparkAttachable, ITickabl
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
public void updateEntity() {
|
||||
IBlockState state = worldObj.getBlockState(getPos());
|
||||
if (state.getBlock() != ModBlocks.enchanter)
|
||||
return;
|
||||
EnumFacing.Axis axis = state.getValue(BotaniaStateProps.ENCHANTER_DIRECTION);
|
||||
|
||||
for(BlockPos pylon : PYLON_LOCATIONS.get(axis)) {
|
||||
|
||||
@@ -24,12 +24,10 @@ import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.item.equipment.tool.ToolCommons;
|
||||
|
||||
public class TileEnderEye extends TileMod implements ITickable {
|
||||
public class TileEnderEye extends TileMod {
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
if (worldObj.getBlockState(getPos()).getBlock() != ModBlocks.enderEye)
|
||||
return;
|
||||
public void updateEntity() {
|
||||
boolean wasLooking = worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.POWERED);
|
||||
int range = 80;
|
||||
List<EntityPlayer> players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(pos.add(-range, -range, -range), pos.add(range, range, range)));
|
||||
|
||||
@@ -14,12 +14,12 @@ import net.minecraft.entity.passive.EntityAnimal;
|
||||
import net.minecraft.util.ITickable;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
|
||||
public class TileForestEye extends TileMod implements ITickable {
|
||||
public class TileForestEye extends TileMod {
|
||||
|
||||
public int entities = 0;
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
public void updateEntity() {
|
||||
int range = 6;
|
||||
int entityCount = worldObj.getEntitiesWithinAABB(EntityAnimal.class, new AxisAlignedBB(pos.add(-range, -range, -range), pos.add(range + 1, range + 1, range + 1))).size();
|
||||
if(entityCount != entities) {
|
||||
|
||||
@@ -26,7 +26,7 @@ import vazkii.botania.api.internal.VanillaPacketDispatcher;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
public class TileHourglass extends TileSimpleInventory implements ITickable {
|
||||
public class TileHourglass extends TileSimpleInventory {
|
||||
|
||||
private static final String TAG_TIME = "time";
|
||||
private static final String TAG_TIME_FRACTION = "timeFraction";
|
||||
@@ -43,8 +43,7 @@ public class TileHourglass extends TileSimpleInventory implements ITickable {
|
||||
public boolean move = true;
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
|
||||
public void updateEntity() {
|
||||
int totalTime = getTotalTime();
|
||||
if(totalTime > 0) {
|
||||
if(move)
|
||||
|
||||
@@ -30,7 +30,7 @@ import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.item.brew.ItemIncenseStick;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
public class TileIncensePlate extends TileSimpleInventory implements ISidedInventory, ITickable {
|
||||
public class TileIncensePlate extends TileSimpleInventory implements ISidedInventory {
|
||||
|
||||
private static final String TAG_TIME_LEFT = "timeLeft";
|
||||
private static final String TAG_BURNING = "burning";
|
||||
@@ -42,7 +42,7 @@ public class TileIncensePlate extends TileSimpleInventory implements ISidedInven
|
||||
public int comparatorOutput = 0;
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
public void updateEntity() {
|
||||
ItemStack stack = getStackInSlot(0);
|
||||
if(stack != null && burning) {
|
||||
Brew brew = ((ItemIncenseStick) ModItems.incenseStick).getBrew(stack);
|
||||
|
||||
@@ -37,7 +37,7 @@ import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.core.helper.MathHelper;
|
||||
import vazkii.botania.common.core.helper.Vector3;
|
||||
|
||||
public class TileLightRelay extends TileMod implements IWandBindable, ITickable {
|
||||
public class TileLightRelay extends TileMod implements IWandBindable {
|
||||
|
||||
private static final int MAX_DIST = 20;
|
||||
|
||||
@@ -63,7 +63,7 @@ public class TileLightRelay extends TileMod implements IWandBindable, ITickable
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
public void updateEntity() {
|
||||
ticksElapsed++;
|
||||
|
||||
if(bindPos.getY() > -1 && isValidBinding()) {
|
||||
|
||||
@@ -16,13 +16,10 @@ import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
|
||||
public class TileManaBeacon extends TileMod implements ITickable {
|
||||
public class TileManaBeacon extends TileMod {
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
if (worldObj.getBlockState(getPos()).getBlock() != ModBlocks.manaBeacon)
|
||||
return;
|
||||
|
||||
public void updateEntity() {
|
||||
boolean redstone = false;
|
||||
for(EnumFacing dir : EnumFacing.VALUES) {
|
||||
int redstoneSide = worldObj.getRedstonePower(pos.offset(dir), dir);
|
||||
|
||||
@@ -15,7 +15,7 @@ import net.minecraft.util.ITickable;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.integration.coloredlights.ColoredLightHelper;
|
||||
|
||||
public class TileManaFlame extends TileMod implements ITickable {
|
||||
public class TileManaFlame extends TileMod {
|
||||
|
||||
private static final String TAG_COLOR = "color";
|
||||
|
||||
@@ -32,7 +32,7 @@ public class TileManaFlame extends TileMod implements ITickable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
public void updateEntity() {
|
||||
float c = 0.3F;
|
||||
|
||||
if(Math.random() < c) {
|
||||
|
||||
@@ -17,9 +17,10 @@ import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.ITickable;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileMod extends TileEntity {
|
||||
public class TileMod extends TileEntity implements ITickable {
|
||||
|
||||
@Override
|
||||
public boolean shouldRefresh(World world, BlockPos pos, IBlockState oldState, IBlockState newState) {
|
||||
@@ -61,4 +62,17 @@ public class TileMod extends TileEntity {
|
||||
readCustomNBT(packet.getNbtCompound());
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void update() {
|
||||
if (worldObj.isBlockLoaded(getPos(), false)) {
|
||||
updateEntity();
|
||||
} else {
|
||||
System.out.println("Skipping a tick because our chunk unloaded");
|
||||
}
|
||||
}
|
||||
|
||||
protected void updateEntity() {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
}
|
||||
@@ -23,7 +23,7 @@ import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
|
||||
public class TileOpenCrate extends TileSimpleInventory implements ITickable {
|
||||
public class TileOpenCrate extends TileSimpleInventory {
|
||||
|
||||
@Override
|
||||
public boolean shouldRefresh(World world, BlockPos pos, IBlockState oldState, IBlockState newState) {
|
||||
@@ -41,7 +41,7 @@ public class TileOpenCrate extends TileSimpleInventory implements ITickable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
public void updateEntity() {
|
||||
boolean redstone = false;
|
||||
for(EnumFacing dir : EnumFacing.VALUES) {
|
||||
int redstoneSide = worldObj.getRedstonePower(pos.offset(dir), dir);
|
||||
|
||||
@@ -43,7 +43,7 @@ import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
|
||||
public class TileRuneAltar extends TileSimpleInventory implements ISidedInventory, IManaReceiver, ITickable {
|
||||
public class TileRuneAltar extends TileSimpleInventory implements ISidedInventory, IManaReceiver {
|
||||
|
||||
private static final String TAG_MANA = "mana";
|
||||
private static final String TAG_MANA_TO_GET = "manaToGet";
|
||||
@@ -106,7 +106,7 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
public void updateEntity() {
|
||||
|
||||
// Update every tick.
|
||||
recieveMana(0);
|
||||
|
||||
@@ -30,7 +30,7 @@ import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
import net.minecraftforge.fml.relauncher.ReflectionHelper;
|
||||
|
||||
public class TileSpawnerClaw extends TileMod implements IManaReceiver, ITickable {
|
||||
public class TileSpawnerClaw extends TileMod implements IManaReceiver {
|
||||
|
||||
private static final String TAG_MANA = "mana";
|
||||
|
||||
@@ -44,7 +44,7 @@ public class TileSpawnerClaw extends TileMod implements IManaReceiver, ITickable
|
||||
private static final Method getEntityNameToSpawn = ReflectionHelper.findMethod(MobSpawnerBaseLogic.class, null, LibObfuscation.GET_ENTITY_TO_SPAWN);
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
public void updateEntity() {
|
||||
TileEntity tileBelow = worldObj.getTileEntity(pos.down());
|
||||
if(mana >= 5 && tileBelow instanceof TileEntityMobSpawner) {
|
||||
TileEntityMobSpawner spawner = (TileEntityMobSpawner) tileBelow;
|
||||
|
||||
@@ -35,7 +35,7 @@ import vazkii.botania.api.wand.IWandBindable;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.tile.string.TileRedStringRelay;
|
||||
|
||||
public class TileSpecialFlower extends TileMod implements IWandBindable, ISubTileSlowableContainer, ITickable {
|
||||
public class TileSpecialFlower extends TileMod implements IWandBindable, ISubTileSlowableContainer {
|
||||
|
||||
private static final String TAG_SUBTILE_NAME = "subTileName";
|
||||
private static final String TAG_SUBTILE_CMP = "subTileCmp";
|
||||
@@ -72,7 +72,7 @@ public class TileSpecialFlower extends TileMod implements IWandBindable, ISubTil
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
public void updateEntity() {
|
||||
if(subTile != null) {
|
||||
TileEntity tileBelow = worldObj.getTileEntity(pos.down());
|
||||
if(tileBelow instanceof TileRedStringRelay) {
|
||||
|
||||
@@ -13,12 +13,12 @@ package vazkii.botania.common.block.tile;
|
||||
import net.minecraft.util.ITickable;
|
||||
import vazkii.botania.common.Botania;
|
||||
|
||||
public class TileSpiritShrine extends TileMod implements ITickable {
|
||||
public class TileSpiritShrine extends TileMod {
|
||||
|
||||
int ticks;
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
public void updateEntity() {
|
||||
if(worldObj.isRemote) {
|
||||
if(ticks >= 40) {
|
||||
float[][] colors = new float[][] {
|
||||
|
||||
@@ -15,13 +15,10 @@ import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
|
||||
public class TileStarfield extends TileMod implements ITickable {
|
||||
public class TileStarfield extends TileMod {
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
if (worldObj.getBlockState(getPos()).getBlock() != ModBlocks.starfield)
|
||||
return;
|
||||
|
||||
public void updateEntity() {
|
||||
boolean state = worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.POWERED);
|
||||
if(!worldObj.isRemote) {
|
||||
boolean newState = !worldObj.isDaytime();
|
||||
|
||||
@@ -34,7 +34,7 @@ import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.tile.mana.TilePool;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
|
||||
public class TileTerraPlate extends TileMod implements ISparkAttachable, ITickable {
|
||||
public class TileTerraPlate extends TileMod implements ISparkAttachable {
|
||||
|
||||
public static final int MAX_MANA = TilePool.MAX_MANA / 2;
|
||||
|
||||
@@ -68,7 +68,7 @@ public class TileTerraPlate extends TileMod implements ISparkAttachable, ITickab
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
public void updateEntity() {
|
||||
boolean removeMana = true;
|
||||
|
||||
if(hasValidPlatform()) {
|
||||
|
||||
@@ -10,14 +10,12 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.tile;
|
||||
|
||||
import net.minecraft.util.ITickable;
|
||||
|
||||
public class TileTeruTeruBozu extends TileMod implements ITickable {
|
||||
public class TileTeruTeruBozu extends TileMod {
|
||||
|
||||
public boolean wasRaining = false;
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
public void updateEntity() {
|
||||
boolean isRaining = worldObj.isRaining();
|
||||
if(isRaining && worldObj.rand.nextInt(9600) == 0)
|
||||
worldObj.getWorldInfo().setRaining(false);
|
||||
|
||||
@@ -14,10 +14,10 @@ import net.minecraft.util.ITickable;
|
||||
import vazkii.botania.api.mana.IManaCollisionGhost;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemTinyPlanet;
|
||||
|
||||
public class TileTinyPlanet extends TileMod implements IManaCollisionGhost, ITickable {
|
||||
public class TileTinyPlanet extends TileMod implements IManaCollisionGhost {
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
public void updateEntity() {
|
||||
ItemTinyPlanet.applyEffect(worldObj, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5);
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ITickable;
|
||||
|
||||
|
||||
public class TileTinyPotato extends TileMod implements ITickable {
|
||||
public class TileTinyPotato extends TileMod {
|
||||
|
||||
private static final String TAG_NAME = "name";
|
||||
|
||||
@@ -36,7 +36,7 @@ public class TileTinyPotato extends TileMod implements ITickable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
public void updateEntity() {
|
||||
if(worldObj.rand.nextInt(100) == 0)
|
||||
jump();
|
||||
|
||||
|
||||
+2
-2
@@ -22,7 +22,7 @@ import vazkii.botania.api.corporea.ICorporeaSpark;
|
||||
import vazkii.botania.api.internal.VanillaPacketDispatcher;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
public class TileCorporeaCrystalCube extends TileCorporeaBase implements ICorporeaRequestor, ITickable {
|
||||
public class TileCorporeaCrystalCube extends TileCorporeaBase implements ICorporeaRequestor {
|
||||
|
||||
private static final String TAG_REQUEST_TARGET = "requestTarget";
|
||||
private static final String TAG_ITEM_COUNT = "itemCount";
|
||||
@@ -35,7 +35,7 @@ public class TileCorporeaCrystalCube extends TileCorporeaBase implements ICorpor
|
||||
public int compValue = 0;
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
public void updateEntity() {
|
||||
++ticks;
|
||||
if(ticks % 20 == 0)
|
||||
updateCount();
|
||||
|
||||
@@ -45,7 +45,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public class TileCorporeaIndex extends TileCorporeaBase implements ICorporeaRequestor, ITickable {
|
||||
public class TileCorporeaIndex extends TileCorporeaBase implements ICorporeaRequestor {
|
||||
|
||||
public static final double RADIUS = 2.5;
|
||||
|
||||
@@ -152,7 +152,7 @@ public class TileCorporeaIndex extends TileCorporeaBase implements ICorporeaRequ
|
||||
public boolean hasCloseby;
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
public void updateEntity() {
|
||||
double x = pos.getX() + 0.5;
|
||||
double y = pos.getY() + 0.5;
|
||||
double z = pos.getZ() + 0.5;
|
||||
|
||||
@@ -22,7 +22,7 @@ import vazkii.botania.api.internal.VanillaPacketDispatcher;
|
||||
import vazkii.botania.common.block.subtile.functional.SubTileExoflame;
|
||||
import vazkii.botania.common.block.tile.TileMod;
|
||||
|
||||
public class TileBellows extends TileMod implements ITickable {
|
||||
public class TileBellows extends TileMod {
|
||||
|
||||
private static final String TAG_ACTIVE = "active";
|
||||
|
||||
@@ -36,7 +36,7 @@ public class TileBellows extends TileMod implements ITickable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
public void updateEntity() {
|
||||
boolean disable = true;
|
||||
TileEntity tile = getLinkedTile();
|
||||
if(!active && tile instanceof TilePool) {
|
||||
|
||||
@@ -22,12 +22,12 @@ import vazkii.botania.api.mana.IManaReceiver;
|
||||
import vazkii.botania.common.block.tile.TileMod;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
public class TileDistributor extends TileMod implements IManaReceiver, ITickable {
|
||||
public class TileDistributor extends TileMod implements IManaReceiver {
|
||||
|
||||
List<IManaReceiver> validPools = new ArrayList();
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
public void updateEntity() {
|
||||
validPools.clear();
|
||||
for(EnumFacing dir : LibMisc.CARDINAL_DIRECTIONS) {
|
||||
TileEntity tileAt = worldObj.getTileEntity(pos.offset(dir));
|
||||
|
||||
@@ -21,11 +21,11 @@ import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.tile.TileMod;
|
||||
|
||||
public class TileManaDetector extends TileMod implements IManaCollisionGhost, ITickable {
|
||||
public class TileManaDetector extends TileMod implements IManaCollisionGhost {
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
if(!worldObj.isRemote && worldObj.getBlockState(getPos()).getBlock() == ModBlocks.manaDetector) {
|
||||
public void updateEntity() {
|
||||
if(!worldObj.isRemote) {
|
||||
boolean state = worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.POWERED);
|
||||
boolean expectedState = worldObj.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(pos, pos.add(1, 1, 1)), Predicates.instanceOf(IManaBurst.class)).size() != 0;
|
||||
if(state != expectedState)
|
||||
|
||||
@@ -67,7 +67,7 @@ import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
|
||||
public class TilePool extends TileMod implements IManaPool, IDyablePool, IKeyLocked, ISparkAttachable, IThrottledPacket, ITickable {
|
||||
public class TilePool extends TileMod implements IManaPool, IDyablePool, IKeyLocked, ISparkAttachable, IThrottledPacket {
|
||||
|
||||
public static final int MAX_MANA = 1000000;
|
||||
public static final int MAX_MANA_DILLUTED = 10000;
|
||||
@@ -198,10 +198,7 @@ public class TilePool extends TileMod implements IManaPool, IDyablePool, IKeyLoc
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
if (worldObj.getBlockState(getPos()).getBlock() != ModBlocks.pool)
|
||||
return;
|
||||
|
||||
public void updateEntity() {
|
||||
boolean wasDoingTransfer = isDoingTransfer;
|
||||
isDoingTransfer = false;
|
||||
if(manaCap == -1)
|
||||
|
||||
@@ -17,7 +17,7 @@ import net.minecraft.util.EnumFacing;
|
||||
import vazkii.botania.api.internal.VanillaPacketDispatcher;
|
||||
import vazkii.botania.common.block.tile.TileMod;
|
||||
|
||||
public class TilePump extends TileMod implements ITickable {
|
||||
public class TilePump extends TileMod {
|
||||
|
||||
private static final String TAG_ACTIVE = "active";
|
||||
|
||||
@@ -32,7 +32,7 @@ public class TilePump extends TileMod implements ITickable {
|
||||
int lastComparator = 0;
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
public void updateEntity() {
|
||||
hasRedstone = false;
|
||||
for(EnumFacing dir : EnumFacing.VALUES) {
|
||||
int redstoneSide = worldObj.getRedstonePower(pos.offset(dir), dir);
|
||||
|
||||
@@ -26,7 +26,7 @@ import java.util.EnumMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Optional.Interface(iface = "cofh.api.energy.IEnergyConnection", modid = "CoFHAPI|energy")
|
||||
public class TileRFGenerator extends TileMod implements IManaReceiver, IEnergyConnection, ITickable {
|
||||
public class TileRFGenerator extends TileMod implements IManaReceiver, IEnergyConnection {
|
||||
|
||||
private static final int CONVERSION_RATE = 10;
|
||||
private static final int MAX_MANA = 1280 * CONVERSION_RATE;
|
||||
@@ -48,7 +48,7 @@ public class TileRFGenerator extends TileMod implements IManaReceiver, IEnergyCo
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
public void updateEntity() {
|
||||
if(!worldObj.isRemote && Loader.isModLoaded("CoFHAPI|energy")) {
|
||||
if(deadCache)
|
||||
reCache();
|
||||
|
||||
@@ -169,7 +169,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
public void updateEntity() {
|
||||
boolean inNetwork = ManaNetworkHandler.instance.isCollectorIn(this);
|
||||
boolean wasInNetwork = inNetwork;
|
||||
if(!inNetwork && !isInvalid()) {
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.lwjgl.opengl.GL11;
|
||||
import vazkii.botania.api.internal.VanillaPacketDispatcher;
|
||||
import vazkii.botania.common.block.tile.TileMod;
|
||||
|
||||
public class TileTurntable extends TileMod implements ITickable {
|
||||
public class TileTurntable extends TileMod {
|
||||
|
||||
private static final String TAG_SPEED = "speed";
|
||||
private static final String TAG_BACKWARDS = "backwards";
|
||||
@@ -35,7 +35,7 @@ public class TileTurntable extends TileMod implements ITickable {
|
||||
boolean backwards = false;
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
public void updateEntity() {
|
||||
boolean redstone = false;
|
||||
|
||||
for(EnumFacing dir : EnumFacing.VALUES) {
|
||||
|
||||
@@ -22,15 +22,12 @@ import vazkii.botania.api.wand.ITileBound;
|
||||
import vazkii.botania.common.block.string.BlockRedString;
|
||||
import vazkii.botania.common.block.tile.TileMod;
|
||||
|
||||
public abstract class TileRedString extends TileMod implements ITileBound, ITickable {
|
||||
public abstract class TileRedString extends TileMod implements ITileBound {
|
||||
|
||||
private BlockPos binding;
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
if (!(worldObj.getBlockState(getPos()).getBlock() instanceof BlockRedString))
|
||||
return;
|
||||
|
||||
public void updateEntity() {
|
||||
EnumFacing dir = getOrientation();
|
||||
BlockPos pos_ = getPos();
|
||||
int range = getRange();
|
||||
|
||||
@@ -19,7 +19,7 @@ public class TileRedStringComparator extends TileRedString {
|
||||
int comparatorValue = 0;
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
public void updateEntity() {
|
||||
BlockPos binding = getBinding();
|
||||
EnumFacing dir = getOrientation();
|
||||
Block block = getBlockAtBinding();
|
||||
|
||||
@@ -20,12 +20,12 @@ import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
|
||||
public class TileRedStringInterceptor extends TileRedString implements ITickable {
|
||||
public class TileRedStringInterceptor extends TileRedString {
|
||||
|
||||
public static List<TileRedStringInterceptor> interceptors = new ArrayList();
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
public void updateEntity() {
|
||||
if(!interceptors.contains(this))
|
||||
interceptors.add(this);
|
||||
}
|
||||
|
||||
@@ -74,9 +74,11 @@ public class EntityFallingStar extends EntityThrowableCopy {
|
||||
else pos.entityHit.attackEntityFrom(DamageSource.generic, 10);
|
||||
}
|
||||
|
||||
Block block = worldObj.getBlockState(pos.getBlockPos()).getBlock();
|
||||
if(ConfigHandler.blockBreakParticles && !block.isAir(worldObj, pos.getBlockPos()))
|
||||
worldObj.playAuxSFX(2001, pos.getBlockPos(), Block.getStateId(worldObj.getBlockState(pos.getBlockPos())));
|
||||
if (pos.getBlockPos() != null) {
|
||||
Block block = worldObj.getBlockState(pos.getBlockPos()).getBlock();
|
||||
if(ConfigHandler.blockBreakParticles && !block.isAir(worldObj, pos.getBlockPos()))
|
||||
worldObj.playAuxSFX(2001, pos.getBlockPos(), Block.getStateId(worldObj.getBlockState(pos.getBlockPos())));
|
||||
}
|
||||
|
||||
setDead();
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public class ItemStarSword extends ItemManasteelSword implements ICraftAchieveme
|
||||
|
||||
if(player.getCurrentEquippedItem() == par1ItemStack && player.swingProgress == check && !par2World.isRemote && par2World.rand.nextInt(2) == 0) {
|
||||
MovingObjectPosition pos = ToolCommons.raytraceFromEntity(par2World, par3Entity, true, 48);
|
||||
if(pos != null) {
|
||||
if(pos != null && pos.getBlockPos() != null) {
|
||||
Vector3 posVec = new Vector3(pos.getBlockPos().getX(), pos.getBlockPos().getY(), pos.getBlockPos().getZ());
|
||||
Vector3 motVec = new Vector3((Math.random() - 0.5) * 18, 24, (Math.random() - 0.5) * 18);
|
||||
posVec.add(motVec);
|
||||
|
||||
Reference in new issue
Block a user