Update mappings to stable_29 for 1.10.2, no functional changes

This commit is contained in:
Vincent Lee committed 2017-01-02 12:24:45 -06:00
1 parent f51b3bdbb2
commit 7321f50d39
252 files changed
+1100 -1100

No files matched your search

@@ -32,7 +32,7 @@ public interface IManaNetwork {
/**
* Gets the closest Mana Collector (eg. Mana Spreader) in the network to the Chunk
* Coordinates passed in, in the given dimension.<br>
* A way of getting the dimension is via worldObj.provider.dimensionId<br>
* A way of getting the dimension is via world.provider.dimensionId<br>
* Note that this function *can* get performance intensive, it's reccomended you
* call it sparingly and take cache of the value returned.
* @param limit The maximum distance the closest block can be, if the closest block
@@ -43,7 +43,7 @@ public interface IManaNetwork {
/**
* Gets the closest Mana Pool in the network to the Chunk Coordinates passed in,
* in the given dimension.<br>
* A way of getting the dimension is via worldObj.provider.dimensionId<br>
* A way of getting the dimension is via world.provider.dimensionId<br>
* Note that this function *can* get performance intensive, it's reccomended you
* call it sparingly and take cache of the value returned.
* @param limit The maximum distance the closest block can be, if the closest block
@@ -137,7 +137,7 @@ public class SubTileFunctional extends SubTileEntity {
return false;
knownMana = mana;
player.worldObj.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.ding, SoundCategory.PLAYERS, 0.1F, 1F);
player.world.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.ding, SoundCategory.PLAYERS, 0.1F, 1F);
return super.onWanded(player, wand);
}
@@ -199,7 +199,7 @@ public class SubTileFunctional extends SubTileEntity {
double dist = pos.distanceSq(supertile.getPos());
if(range >= dist) {
TileEntity tile = player.worldObj.getTileEntity(pos);
TileEntity tile = player.world.getTileEntity(pos);
if(tile instanceof IManaPool) {
linkedPool = tile;
return true;
@@ -210,7 +210,7 @@ public class SubTileFunctional extends SubTileEntity {
}
public boolean isValidBinding() {
return linkedPool != null && linkedPool.hasWorldObj() && !linkedPool.isInvalid() && supertile.getWorld().isBlockLoaded(linkedPool.getPos(), false) && supertile.getWorld().getTileEntity(linkedPool.getPos()) == linkedPool;
return linkedPool != null && linkedPool.hasWorld() && !linkedPool.isInvalid() && supertile.getWorld().isBlockLoaded(linkedPool.getPos(), false) && supertile.getWorld().getTileEntity(linkedPool.getPos()) == linkedPool;
}
@SideOnly(Side.CLIENT)
@@ -220,11 +220,11 @@ public class SubTileGenerating extends SubTileEntity {
if(player == null)
return false;
if(!player.worldObj.isRemote)
if(!player.world.isRemote)
sync();
knownMana = mana;
player.worldObj.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.ding, SoundCategory.PLAYERS, 0.1F, 1F);
player.world.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.ding, SoundCategory.PLAYERS, 0.1F, 1F);
return super.onWanded(player, wand);
}
@@ -289,7 +289,7 @@ public class SubTileGenerating extends SubTileEntity {
double dist = pos.distanceSq(supertile.getPos());
if(range >= dist) {
TileEntity tile = player.worldObj.getTileEntity(pos);
TileEntity tile = player.world.getTileEntity(pos);
if(tile instanceof IManaCollector) {
linkedCollector = tile;
return true;
@@ -36,7 +36,7 @@ public final class AstrolabePreviewHandler {
@SubscribeEvent
public static void onWorldRenderLast(RenderWorldLastEvent event) {
World world = Minecraft.getMinecraft().theWorld;
World world = Minecraft.getMinecraft().world;
List<EntityPlayer> playerEntities = world.playerEntities;
for (EntityPlayer player : playerEntities) {
ItemStack currentStack = player.getHeldItemMainhand();
@@ -55,14 +55,14 @@ public final class BlockHighlightRenderHandler {
if(Botania.proxy.isClientPlayerWearingMonocle() && pos != null && pos.entityHit == null) {
BlockPos bPos = pos.getBlockPos();
ItemStack stackHeld = PlayerHelper.getFirstHeldItem(mc.thePlayer, ModItems.twigWand);
ItemStack stackHeld = PlayerHelper.getFirstHeldItem(mc.player, ModItems.twigWand);
if(stackHeld != null && ItemTwigWand.getBindMode(stackHeld)) {
BlockPos coords = ItemTwigWand.getBoundTile(stackHeld);
if(coords.getY() != -1)
bPos = coords;
}
TileEntity tile = mc.theWorld.getTileEntity(bPos);
TileEntity tile = mc.world.getTileEntity(bPos);
if(tile == null || !(tile instanceof ISubTileContainer))
break boundTile;
ISubTileContainer container = (ISubTileContainer) tile;
@@ -80,7 +80,7 @@ public final class BlockHighlightRenderHandler {
}
double offY = -1.0 / 16 + 0.005;
for(Entity e : mc.theWorld.loadedEntityList)
for(Entity e : mc.world.loadedEntityList)
if(e instanceof EntityMagicLandmine) {
BlockPos bpos = e.getPosition();
AxisAlignedBB aabb = new AxisAlignedBB(bpos).offset(0, offY, 0).expand(2.5, 0, 2.5);
@@ -50,7 +50,7 @@ public final class BoundTileRenderer {
GlStateManager.disableTexture2D();
GlStateManager.enableBlend();
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
EntityPlayer player = Minecraft.getMinecraft().player;
int color = Color.HSBtoRGB(ClientTickHandler.ticksInGame % 200 / 200F, 0.6F, 1F);
if(player.getHeldItemMainhand() != null && player.getHeldItemMainhand().getItem() instanceof ICoordBoundItem) {
@@ -112,7 +112,7 @@ public final class BoundTileRenderer {
Color colorRGB = new Color(color);
GL11.glColor4ub((byte) colorRGB.getRed(), (byte) colorRGB.getGreen(), (byte) colorRGB.getBlue(), (byte) 255);
World world = Minecraft.getMinecraft().theWorld;
World world = Minecraft.getMinecraft().world;
IBlockState state = world.getBlockState(pos);
Block block = state.getBlock();
drawWireframe : {
@@ -61,7 +61,7 @@ public final class ClientTickHandler {
RedStringRenderer.tick();
ItemsRemainingRenderHandler.tick();
if(Minecraft.getMinecraft().theWorld == null) {
if(Minecraft.getMinecraft().world == null) {
ManaNetworkHandler.instance.clear();
TileCorporeaIndex.indexes.clear();
SubTileVinculotus.existingFlowers.clear();
@@ -72,10 +72,10 @@ public final class ClientTickHandler {
ticksInGame++;
partialTicks = 0;
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
EntityPlayer player = Minecraft.getMinecraft().player;
if(player != null) {
if(PlayerHelper.hasHeldItemClass(player, ModItems.twigWand)) {
for(TileSignature sig : ImmutableList.copyOf(ManaNetworkHandler.instance.getAllCollectorsInWorld(Minecraft.getMinecraft().theWorld))) {
for(TileSignature sig : ImmutableList.copyOf(ManaNetworkHandler.instance.getAllCollectorsInWorld(Minecraft.getMinecraft().world))) {
if(!sig.isRemote())
continue;
@@ -142,7 +142,7 @@ public final class ColorHandler {
return Minecraft.getMinecraft().getItemColors().getColorFromItemstack(lens, t);
if(t == 2) {
EntityManaBurst burst = ((ItemManaGun) s.getItem()).getBurst(Minecraft.getMinecraft().thePlayer, s, false);
EntityManaBurst burst = ((ItemManaGun) s.getItem()).getBurst(Minecraft.getMinecraft().player, s, false);
Color color = new Color(burst == null ? 0x20FF20 : burst.getColor());
float mul = (float) (Math.sin((double) ClientTickHandler.ticksInGame / 5) * 0.15F);
@@ -45,7 +45,7 @@ public final class DebugHandler {
@SubscribeEvent
public static void onDrawDebugText(RenderGameOverlayEvent.Text event) {
World world = Minecraft.getMinecraft().theWorld;
World world = Minecraft.getMinecraft().world;
if(Minecraft.getMinecraft().gameSettings.showDebugInfo) {
event.getLeft().add("");
String version = LibMisc.VERSION;
@@ -56,10 +56,10 @@ public final class DebugHandler {
event.getLeft().add(PREFIX + "(CLIENT) netColl: " + ManaNetworkHandler.instance.getAllCollectorsInWorld(world).size() + ", netPool: " + ManaNetworkHandler.instance.getAllPoolsInWorld(world).size() + ", rv: " + version);
if (Minecraft.getMinecraft().isSingleplayer()) {
UUID id = Minecraft.getMinecraft().thePlayer.getUniqueID();
UUID id = Minecraft.getMinecraft().player.getUniqueID();
Entity ent = Minecraft.getMinecraft().getIntegratedServer().getEntityFromUuid(id);
if (ent != null) {
World serverWorld = Minecraft.getMinecraft().getIntegratedServer().getEntityFromUuid(id).worldObj;
World serverWorld = Minecraft.getMinecraft().getIntegratedServer().getEntityFromUuid(id).world;
event.getLeft().add(PREFIX + String.format("(INTEGRATED SERVER DIM %d) netColl : %d, netPool: %d", serverWorld.provider.getDimension(), ManaNetworkHandler.instance.getAllCollectorsInWorld(serverWorld).size(), ManaNetworkHandler.instance.getAllPoolsInWorld(serverWorld).size()));
}
}
@@ -88,11 +88,11 @@ public final class HUDHandler {
if(event.getType() == ElementType.HEALTH) {
profiler.startSection("botania-hud");
IInventory baublesInv = BaublesApi.getBaubles(mc.thePlayer);
IInventory baublesInv = BaublesApi.getBaubles(mc.player);
ItemStack headpiece = baublesInv.getStackInSlot(4);
if(headpiece != null && headpiece.getItem() == ModItems.flightTiara) {
profiler.startSection("flugelTiara");
ItemFlightTiara.renderHUD(event.getResolution(), mc.thePlayer, headpiece);
ItemFlightTiara.renderHUD(event.getResolution(), mc.player, headpiece);
profiler.endSection();
}
@@ -105,7 +105,7 @@ public final class HUDHandler {
}
profiler.startSection("dodgeRing");
ItemDodgeRing.renderHUD(event.getResolution(), mc.thePlayer, ring, event.getPartialTicks());
ItemDodgeRing.renderHUD(event.getResolution(), mc.player, ring, event.getPartialTicks());
profiler.endSection();
}
@@ -117,31 +117,31 @@ public final class HUDHandler {
public static void onDrawScreenPost(RenderGameOverlayEvent.Post event) {
Minecraft mc = Minecraft.getMinecraft();
Profiler profiler = mc.mcProfiler;
ItemStack main = mc.thePlayer.getHeldItemMainhand();
ItemStack offhand = mc.thePlayer.getHeldItemOffhand();
ItemStack main = mc.player.getHeldItemMainhand();
ItemStack offhand = mc.player.getHeldItemOffhand();
if(event.getType() == ElementType.ALL) {
profiler.startSection("botania-hud");
RayTraceResult pos = mc.objectMouseOver;
if(pos != null) {
IBlockState state = pos.typeOfHit == RayTraceResult.Type.BLOCK ? mc.theWorld.getBlockState(pos.getBlockPos()) : null;
IBlockState state = pos.typeOfHit == RayTraceResult.Type.BLOCK ? mc.world.getBlockState(pos.getBlockPos()) : null;
Block block = state == null ? null : state.getBlock();
TileEntity tile = pos.typeOfHit == RayTraceResult.Type.BLOCK ? mc.theWorld.getTileEntity(pos.getBlockPos()) : null;
TileEntity tile = pos.typeOfHit == RayTraceResult.Type.BLOCK ? mc.world.getTileEntity(pos.getBlockPos()) : null;
if(PlayerHelper.hasAnyHeldItem(mc.thePlayer)) {
if(pos != null && PlayerHelper.hasHeldItem(mc.thePlayer, ModItems.twigWand)) {
renderWandModeDisplay(PlayerHelper.getFirstHeldItem(mc.thePlayer, ModItems.twigWand), event.getResolution());
if(PlayerHelper.hasAnyHeldItem(mc.player)) {
if(pos != null && PlayerHelper.hasHeldItem(mc.player, ModItems.twigWand)) {
renderWandModeDisplay(PlayerHelper.getFirstHeldItem(mc.player, ModItems.twigWand), event.getResolution());
if(block instanceof IWandHUD) {
profiler.startSection("wandItem");
((IWandHUD) block).renderHUD(mc, event.getResolution(), mc.theWorld, pos.getBlockPos());
((IWandHUD) block).renderHUD(mc, event.getResolution(), mc.world, pos.getBlockPos());
profiler.endSection();
}
} else if(block != null && PlayerHelper.hasHeldItemClass(mc.thePlayer, ILexicon.class))
drawLexiconHUD(PlayerHelper.getFirstHeldItemClass(mc.thePlayer, ILexicon.class), state, pos, event.getResolution());
if(tile != null && tile instanceof TilePool && mc.thePlayer.getHeldItemMainhand() != null)
renderPoolRecipeHUD(event.getResolution(), (TilePool) tile, mc.thePlayer.getHeldItemMainhand());
} else if(block != null && PlayerHelper.hasHeldItemClass(mc.player, ILexicon.class))
drawLexiconHUD(PlayerHelper.getFirstHeldItemClass(mc.player, ILexicon.class), state, pos, event.getResolution());
if(tile != null && tile instanceof TilePool && mc.player.getHeldItemMainhand() != null)
renderPoolRecipeHUD(event.getResolution(), (TilePool) tile, mc.player.getHeldItemMainhand());
}
if(tile != null && tile instanceof TileAltar)
((TileAltar) tile).renderHUD(mc, event.getResolution());
@@ -153,7 +153,7 @@ public final class HUDHandler {
}
TileCorporeaIndex.getInputHandler();
if(!InputHandler.getNearbyIndexes(mc.thePlayer).isEmpty() && mc.currentScreen != null && mc.currentScreen instanceof GuiChat) {
if(!InputHandler.getNearbyIndexes(mc.player).isEmpty() && mc.currentScreen != null && mc.currentScreen instanceof GuiChat) {
profiler.startSection("nearIndex");
renderNearIndexDisplay(event.getResolution());
profiler.endSection();
@@ -168,35 +168,35 @@ public final class HUDHandler {
if(main != null && main.getItem() instanceof ItemCraftingHalo) {
profiler.startSection("craftingHalo_main");
ItemCraftingHalo.renderHUD(event.getResolution(), mc.thePlayer, main);
ItemCraftingHalo.renderHUD(event.getResolution(), mc.player, main);
profiler.endSection();
} else if(offhand != null && offhand.getItem() instanceof ItemCraftingHalo) {
profiler.startSection("craftingHalo_off");
ItemCraftingHalo.renderHUD(event.getResolution(), mc.thePlayer, offhand);
ItemCraftingHalo.renderHUD(event.getResolution(), mc.player, offhand);
profiler.endSection();
}
if(main != null && main.getItem() instanceof ItemSextant) {
profiler.startSection("sextant");
ItemSextant.renderHUD(event.getResolution(), mc.thePlayer, main);
ItemSextant.renderHUD(event.getResolution(), mc.player, main);
profiler.endSection();
}
/*if(equippedStack != null && equippedStack.getItem() == ModItems.flugelEye) {
profiler.startSection("flugelEye");
ItemFlugelEye.renderHUD(event.getResolution(), mc.thePlayer, equippedStack);
ItemFlugelEye.renderHUD(event.getResolution(), mc.player, equippedStack);
profiler.endSection();
}*/
if(Botania.proxy.isClientPlayerWearingMonocle()) {
profiler.startSection("monocle");
ItemMonocle.renderHUD(event.getResolution(), mc.thePlayer);
ItemMonocle.renderHUD(event.getResolution(), mc.player);
profiler.endSection();
}
profiler.startSection("manaBar");
EntityPlayer player = mc.thePlayer;
EntityPlayer player = mc.player;
if(!player.isSpectator()) {
int totalMana = 0;
int totalMaxMana = 0;
@@ -322,7 +322,7 @@ public final class HUDHandler {
int y = res.getScaledHeight() / 2 + 10;
int u = tile.getCurrentMana() >= recipe.getManaToConsume() ? 0 : 22;
int v = mc.thePlayer.getName().equals("haighyorkie") && mc.thePlayer.isSneaking() ? 23 : 8;
int v = mc.player.getName().equals("haighyorkie") && mc.player.isSneaking() ? 23 : 8;
GlStateManager.enableBlend();
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
@@ -386,7 +386,7 @@ public final class HUDHandler {
int sy = res.getScaledHeight() / 2 + 2;
if(block instanceof ILexiconable) {
LexiconEntry entry = ((ILexiconable) block).getEntry(mc.theWorld, pos.getBlockPos(), mc.thePlayer, stack);
LexiconEntry entry = ((ILexiconable) block).getEntry(mc.world, pos.getBlockPos(), mc.player, stack);
if(entry != null) {
if(!((ILexicon) stack.getItem()).isKnowledgeUnlocked(stack, entry.getKnowledgeType()))
font = mc.standardGalacticFontRenderer;
@@ -399,12 +399,12 @@ public final class HUDHandler {
if(!draw && pos.entityHit == null) {
profiler.startSection("wikiLookup");
if(!block.isAir(state, mc.theWorld, pos.getBlockPos()) && !(block instanceof BlockLiquid)) {
if(!block.isAir(state, mc.world, pos.getBlockPos()) && !(block instanceof BlockLiquid)) {
IWikiProvider provider = WikiHooks.getWikiFor(block);
String url = provider.getWikiURL(mc.theWorld, pos, mc.thePlayer);
String url = provider.getWikiURL(mc.world, pos, mc.player);
if(url != null && !url.isEmpty()) {
String name = provider.getBlockName(mc.theWorld, pos, mc.thePlayer);
String wikiName = provider.getWikiName(mc.theWorld, pos, mc.thePlayer);
String name = provider.getBlockName(mc.world, pos, mc.player);
String wikiName = provider.getWikiName(mc.world, pos, mc.player);
drawStr = name + " @ " + TextFormatting.AQUA + wikiName;
draw = true;
}
@@ -413,7 +413,7 @@ public final class HUDHandler {
}
if(draw) {
if(!mc.thePlayer.isSneaking()) {
if(!mc.player.isSneaking()) {
drawStr = "?";
secondLine = "";
font = mc.fontRendererObj;
@@ -424,7 +424,7 @@ public final class HUDHandler {
font.drawStringWithShadow(drawStr, sx + 20, sy + 4, 0xFFFFFFFF);
font.drawStringWithShadow(secondLine, sx + 20, sy + 14, 0xFFAAAAAA);
if(!mc.thePlayer.isSneaking()) {
if(!mc.player.isSneaking()) {
GlStateManager.scale(0.5F, 0.5F, 1F);
mc.fontRendererObj.drawStringWithShadow(TextFormatting.BOLD + "Shift", (sx + 10) * 2 - 16, (sy + 8) * 2 + 20, 0xFFFFFFFF);
GlStateManager.scale(2F, 2F, 1F);
@@ -49,7 +49,7 @@ public class LightningHandler {
profiler.endStartSection("lightning");
float frame = event.getPartialTicks();
Entity entity = Minecraft.getMinecraft().thePlayer;
Entity entity = Minecraft.getMinecraft().player;
TextureManager render = Minecraft.getMinecraft().renderEngine;
double interpPosX = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * frame;
@@ -179,7 +179,7 @@ public class MiscellaneousIcons {
@SubscribeEvent
public void dumpAtlas(ArrowLooseEvent evt) {
if (!evt.getEntityPlayer().worldObj.isRemote || !((Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment"))
if (!evt.getEntityPlayer().world.isRemote || !((Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment"))
|| !evt.getEntityPlayer().isSneaking())
return;
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
@@ -85,9 +85,9 @@ public class MultiblockBlockAccess implements IBlockAccess {
@Nonnull
@Override
public Biome getBiomeGenForCoords(@Nonnull BlockPos pos) {
public Biome getBiome(@Nonnull BlockPos pos) {
if(hasBlockAccess)
return originalBlockAccess.getBiomeGenForCoords(pos);
return originalBlockAccess.getBiome(pos);
return null;
}
@@ -77,21 +77,21 @@ public final class MultiblockRenderHandler {
angle = EnumFacing.SOUTH;
Minecraft mc = Minecraft.getMinecraft();
if(mc.theWorld != null)
dimension = mc.theWorld.provider.getDimension();
if(mc.world != null)
dimension = mc.world.provider.getDimension();
}
@SubscribeEvent
public static void onWorldRenderLast(RenderWorldLastEvent event) {
Minecraft mc = Minecraft.getMinecraft();
if(mc.thePlayer != null && mc.objectMouseOver != null && mc.objectMouseOver.getBlockPos() != null && (!mc.thePlayer.isSneaking() || anchor != null)) {
renderPlayerLook(mc.thePlayer, mc.objectMouseOver);
if(mc.player != null && mc.objectMouseOver != null && mc.objectMouseOver.getBlockPos() != null && (!mc.player.isSneaking() || anchor != null)) {
renderPlayerLook(mc.player, mc.objectMouseOver);
}
}
@SubscribeEvent
public static void onPlayerInteract(PlayerInteractEvent.RightClickBlock event) {
if(currentMultiblock != null && anchor == null && event.getEntityPlayer() == Minecraft.getMinecraft().thePlayer) {
if(currentMultiblock != null && anchor == null && event.getEntityPlayer() == Minecraft.getMinecraft().player) {
anchor = event.getPos();
angle = event.getEntityPlayer().getHorizontalFacing();
event.setCanceled(true);
@@ -99,7 +99,7 @@ public final class MultiblockRenderHandler {
}
private static void renderPlayerLook(EntityPlayer player, RayTraceResult src) {
if(currentMultiblock != null && dimension == player.worldObj.provider.getDimension()) {
if(currentMultiblock != null && dimension == player.world.provider.getDimension()) {
BlockPos anchorPos = anchor != null ? anchor : src.getBlockPos();
GlStateManager.pushMatrix();
@@ -111,7 +111,7 @@ public final class MultiblockRenderHandler {
Multiblock mb = anchor != null ? currentMultiblock.getForFacing(angle) : currentMultiblock.getForEntity(player);
boolean didAny = false;
blockAccess.update(player.worldObj, mb, anchorPos);
blockAccess.update(player.world, mb, anchorPos);
ShaderHelper.useShader(ShaderHelper.alpha, shader -> {
int alpha = ARBShaderObjects.glGetUniformLocationARB(shader, "alpha");
@@ -119,7 +119,7 @@ public final class MultiblockRenderHandler {
});
for(MultiblockComponent comp : mb.getComponents()) {
if(renderComponentInWorld(player.worldObj, mb, comp, anchorPos))
if(renderComponentInWorld(player.world, mb, comp, anchorPos))
didAny = true;
}
@@ -131,7 +131,7 @@ public final class MultiblockRenderHandler {
if(!didAny) {
setMultiblock(null);
player.addChatComponentMessage(new TextComponentTranslation("botaniamisc.structureComplete").setStyle(new Style().setColor(TextFormatting.GREEN)));
player.sendMessage(new TextComponentTranslation("botaniamisc.structureComplete").setStyle(new Style().setColor(TextFormatting.GREEN)));
}
}
}
@@ -56,7 +56,7 @@ public final class RedStringRenderer {
}
public static void tick() {
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
EntityPlayer player = Minecraft.getMinecraft().player;
boolean hasWand = player != null && PlayerHelper.hasHeldItem(player, ModItems.twigWand);
if(sizeAlpha > 0F && !hasWand)
sizeAlpha -= 0.1F;
@@ -44,12 +44,12 @@ public class RenderLexicon {
Minecraft mc = Minecraft.getMinecraft();
if(!ConfigHandler.lexicon3dModel
|| mc.gameSettings.thirdPersonView != 0
|| mc.thePlayer.getHeldItem(evt.getHand()) == null
|| mc.thePlayer.getHeldItem(evt.getHand()).getItem() != ModItems.lexicon)
|| mc.player.getHeldItem(evt.getHand()) == null
|| mc.player.getHeldItem(evt.getHand()).getItem() != ModItems.lexicon)
return;
evt.setCanceled(true);
try {
renderItemInFirstPerson(mc.thePlayer, evt.getPartialTicks(), evt.getInterpolatedPitch(), evt.getHand(), evt.getSwingProgress(), evt.getItemStack(), evt.getEquipProgress());
renderItemInFirstPerson(mc.player, evt.getPartialTicks(), evt.getInterpolatedPitch(), evt.getHand(), evt.getSwingProgress(), evt.getItemStack(), evt.getEquipProgress());
} catch (Throwable throwable) {
Botania.LOGGER.warn("Failed to render lexicon");
}
@@ -61,8 +61,8 @@ public class RenderLexicon {
EnumHandSide enumhandside = flag ? player.getPrimaryHand() : player.getPrimaryHand().opposite();
GlStateManager.pushMatrix();
boolean flag1 = enumhandside == EnumHandSide.RIGHT;
float f = -0.4F * MathHelper.sin(MathHelper.sqrt_float(swingProgress) * (float)Math.PI);
float f1 = 0.2F * MathHelper.sin(MathHelper.sqrt_float(swingProgress) * ((float)Math.PI * 2F));
float f = -0.4F * MathHelper.sin(MathHelper.sqrt(swingProgress) * (float)Math.PI);
float f1 = 0.2F * MathHelper.sin(MathHelper.sqrt(swingProgress) * ((float)Math.PI * 2F));
float f2 = -0.2F * MathHelper.sin(swingProgress * (float)Math.PI);
int i = flag1 ? 1 : -1;
GlStateManager.translate(i * f, f1, f2);
@@ -115,7 +115,7 @@ public class RenderLexicon {
font.drawString(TextFormatting.ITALIC + "" + TextFormatting.BOLD + I18n.format("botaniamisc.edition", ItemLexicon.getEdition()), 0, 0, 0xA07100);
if(quote == -1)
quote = mc.theWorld.rand.nextInt(QUOTES.length);
quote = mc.world.rand.nextInt(QUOTES.length);
String quoteStr = QUOTES[quote];
@@ -159,7 +159,7 @@ public class RenderLexicon {
// End add
float f = MathHelper.sin(p_187453_2_ * p_187453_2_ * (float)Math.PI);
GlStateManager.rotate(i * (45.0F + f * -20.0F), 0.0F, 1.0F, 0.0F);
float f1 = MathHelper.sin(MathHelper.sqrt_float(p_187453_2_) * (float)Math.PI);
float f1 = MathHelper.sin(MathHelper.sqrt(p_187453_2_) * (float)Math.PI);
GlStateManager.rotate(i * f1 * -20.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.rotate(f1 * -80.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(i * -45.0F, 0.0F, 1.0F, 0.0F);
@@ -66,7 +66,7 @@ public final class TooltipAdditionDisplayHandler {
ItemStack lexiconStack = null;
for(int i = 0; i < InventoryPlayer.getHotbarSize(); i++) {
ItemStack stackAt = mc.thePlayer.inventory.getStackInSlot(i);
ItemStack stackAt = mc.player.inventory.getStackInSlot(i);
if(stackAt != null && stackAt.getItem() instanceof ILexicon && ((ILexicon) stackAt.getItem()).isKnowledgeUnlocked(stackAt, data.entry.getKnowledgeType())) {
lexiconStack = stackAt;
lexSlot = i;
@@ -115,11 +115,11 @@ public final class TooltipAdditionDisplayHandler {
GlStateManager.shadeModel(GL11.GL_FLAT);
if(lexiconLookupTime >= time) {
mc.thePlayer.inventory.currentItem = lexSlot;
mc.player.inventory.currentItem = lexSlot;
Botania.proxy.setEntryToOpen(data.entry);
Botania.proxy.setLexiconStack(lexiconStack);
mc.thePlayer.closeScreen();
ItemLexicon.openBook(mc.thePlayer, lexiconStack, mc.theWorld, false);
mc.player.closeScreen();
ItemLexicon.openBook(mc.player, lexiconStack, mc.world, false);
}
} else lexiconLookupTime = 0F;
@@ -317,23 +317,23 @@ public class ClientProxy implements IProxy {
@Override
public boolean isTheClientPlayer(EntityLivingBase entity) {
return entity == Minecraft.getMinecraft().thePlayer;
return entity == Minecraft.getMinecraft().player;
}
@Override
public EntityPlayer getClientPlayer() {
return Minecraft.getMinecraft().thePlayer;
return Minecraft.getMinecraft().player;
}
@Override
public boolean isClientPlayerWearingMonocle() {
return ItemMonocle.hasMonocle(Minecraft.getMinecraft().thePlayer);
return ItemMonocle.hasMonocle(Minecraft.getMinecraft().player);
}
@Override
public void setExtraReach(EntityLivingBase entity, float reach) {
Minecraft mc = Minecraft.getMinecraft();
EntityPlayer player = mc.thePlayer;
EntityPlayer player = mc.player;
if(entity == player) {
if(!(mc.playerController instanceof IExtendedPlayerController)) {
NetHandlerPlayClient net = ReflectionHelper.getPrivateValue(PlayerControllerMP.class, mc.playerController, LibObfuscation.NET_CLIENT_HANDLER);
@@ -353,7 +353,7 @@ public class ClientProxy implements IProxy {
@Override
public boolean openWikiPage(World world, Block block, RayTraceResult pos) {
IWikiProvider wiki = WikiHooks.getWikiFor(block);
String url = wiki.getWikiURL(world, pos, Minecraft.getMinecraft().thePlayer);
String url = wiki.getWikiURL(world, pos, Minecraft.getMinecraft().player);
if(url != null && !url.isEmpty()) {
try {
Desktop.getDesktop().browse(new URI(url));
@@ -441,7 +441,7 @@ public class ClientProxy implements IProxy {
if(!doParticle() && !fake)
return;
FXSparkle sparkle = new FXSparkle(Minecraft.getMinecraft().theWorld, x, y, z, size, r, g, b, m);
FXSparkle sparkle = new FXSparkle(Minecraft.getMinecraft().world, x, y, z, size, r, g, b, m);
sparkle.fake = sparkle.noClip = fake;
if(noclipEnabled)
sparkle.noClip = true;
@@ -468,7 +468,7 @@ public class ClientProxy implements IProxy {
if(!doParticle())
return;
FXWisp wisp = new FXWisp(Minecraft.getMinecraft().theWorld, x, y, z, size, r, g, b, distanceLimit, depthTest, maxAgeMul);
FXWisp wisp = new FXWisp(Minecraft.getMinecraft().world, x, y, z, size, r, g, b, distanceLimit, depthTest, maxAgeMul);
wisp.setSpeed(motionx, motiony, motionz);
Minecraft.getMinecraft().effectRenderer.addEffect(wisp);
}
@@ -491,7 +491,7 @@ public class ClientProxy implements IProxy {
@Override
public void lightningFX(Vector3 vectorStart, Vector3 vectorEnd, float ticksPerMeter, long seed, int colorOuter, int colorInner) {
Minecraft.getMinecraft().effectRenderer.addEffect(new FXLightning(Minecraft.getMinecraft().theWorld, vectorStart, vectorEnd, ticksPerMeter, seed, colorOuter, colorInner));
Minecraft.getMinecraft().effectRenderer.addEffect(new FXLightning(Minecraft.getMinecraft().world, vectorStart, vectorEnd, ticksPerMeter, seed, colorOuter, colorInner));
}
@Override
@@ -180,15 +180,15 @@ public class FXLightning extends Particle {
}
private float rayTraceResistance(Vector3 start, Vector3 end, float prevresistance) {
RayTraceResult mop = worldObj.rayTraceBlocks(start.toVec3D(), end.toVec3D());
RayTraceResult mop = world.rayTraceBlocks(start.toVec3D(), end.toVec3D());
if(mop == null)
return prevresistance;
if(mop.typeOfHit == RayTraceResult.Type.BLOCK) {
Block block = worldObj.getBlockState(mop.getBlockPos()).getBlock();
Block block = world.getBlockState(mop.getBlockPos()).getBlock();
if(worldObj.isAirBlock(mop.getBlockPos()))
if(world.isAirBlock(mop.getBlockPos()))
return prevresistance;
return prevresistance + block.getExplosionResistance(null) + 0.3F;
@@ -141,7 +141,7 @@ public class FXSparkle extends Particle {
motionY -= 0.04D * particleGravity;
if (!noClip && !fake)
wiggleAround(posX, (getEntityBoundingBox().minY + getEntityBoundingBox().maxY) / 2.0D, posZ);
wiggleAround(posX, (getBoundingBox().minY + getBoundingBox().maxY) / 2.0D, posZ);
posX += motionX;
posY += motionY;
@@ -175,37 +175,37 @@ public class FXSparkle extends Particle {
double d2 = z - blockpos.getZ();
// Botania - change collision box list check to !airblock check
if (!worldObj.isAirBlock(blockpos))
if (!world.isAirBlock(blockpos))
{
EnumFacing enumfacing = EnumFacing.UP;
double d3 = Double.MAX_VALUE;
if (!worldObj.isBlockFullCube(blockpos.west()) && d0 < d3)
if (!world.isBlockFullCube(blockpos.west()) && d0 < d3)
{
d3 = d0;
enumfacing = EnumFacing.WEST;
}
if (!worldObj.isBlockFullCube(blockpos.east()) && 1.0D - d0 < d3)
if (!world.isBlockFullCube(blockpos.east()) && 1.0D - d0 < d3)
{
d3 = 1.0D - d0;
enumfacing = EnumFacing.EAST;
}
if (!worldObj.isBlockFullCube(blockpos.north()) && d2 < d3)
if (!world.isBlockFullCube(blockpos.north()) && d2 < d3)
{
d3 = d2;
enumfacing = EnumFacing.NORTH;
}
if (!worldObj.isBlockFullCube(blockpos.south()) && 1.0D - d2 < d3)
if (!world.isBlockFullCube(blockpos.south()) && 1.0D - d2 < d3)
{
d3 = 1.0D - d2;
enumfacing = EnumFacing.SOUTH;
}
if (!worldObj.isBlockFullCube(blockpos.up()) && 1.0D - d1 < d3)
if (!world.isBlockFullCube(blockpos.up()) && 1.0D - d1 < d3)
{
d3 = 1.0D - d1;
enumfacing = EnumFacing.UP;
@@ -53,8 +53,8 @@ public class GuiFlowerBag extends GuiContainer {
SlotItemHandler slotf = (SlotItemHandler) slot;
if(!slotf.getHasStack()) {
ItemStack stack = new ItemStack(ModBlocks.flower, 0, slotf.getSlotIndex()); // index matches colors
int x = guiLeft + slotf.xDisplayPosition;
int y = guiTop + slotf.yDisplayPosition;
int x = guiLeft + slotf.xPos;
int y = guiTop + slotf.yPos;
RenderHelper.enableGUIStandardItemLighting();
mc.getRenderItem().renderItemIntoGUI(stack, x, y);
RenderHelper.disableStandardItemLighting();
@@ -36,10 +36,10 @@ public class GuiBaubleBox extends GuiContainer {
for(int i1 = 0; i1 < 7; ++i1) {
Slot slot = inventorySlots.inventorySlots.get(i1);
if(slot.getHasStack() && slot.getSlotStackLimit() == 1)
drawTexturedModalRect(guiLeft+slot.xDisplayPosition, guiTop+slot.yDisplayPosition, 200, 0, 16, 16);
drawTexturedModalRect(guiLeft+slot.xPos, guiTop+slot.yPos, 200, 0, 16, 16);
}
// GuiInventory.drawEntityOnScreen(guiLeft + 43, guiTop + 61, 20, guiLeft + 43 - mouseX, guiTop + 45 - 30 - mouseY, mc.thePlayer);
// GuiInventory.drawEntityOnScreen(guiLeft + 43, guiTop + 61, 20, guiLeft + 43 - mouseX, guiTop + 45 - 30 - mouseY, mc.player);
}
}
@@ -291,7 +291,7 @@ public class GuiLexicon extends GuiScreen {
bookmarksNeedPopulation = false;
}
if(mc.thePlayer.getName().equals("haighyorkie")) {
if(mc.player.getName().equals("haighyorkie")) {
GlStateManager.color(1F, 1F, 1F, 1F);
mc.renderEngine.bindTexture(texture);
drawTexturedModalRect(left - 19, top + 42, 67, 180, 19, 26);
@@ -435,7 +435,7 @@ public class GuiLexicon extends GuiScreen {
mc.displayGuiScreen(new GuiBotaniaConfig(this));
break;
case -2 :
mc.displayGuiScreen(new GuiAchievementsHacky(this, mc.thePlayer.getStatFileWriter()));
mc.displayGuiScreen(new GuiAchievementsHacky(this, mc.player.getStatFileWriter()));
break;
case -3 :
mc.displayGuiScreen(new GuiLexiconChallengesList());
@@ -165,7 +165,7 @@ public class GuiLexiconEntry extends GuiLexicon implements IGuiLexiconEntry, IPa
String cmd = "/botania-share " + entry.getUnlocalizedName();
mc.ingameGUI.getChatGUI().addToSentMessages(cmd);
mc.thePlayer.sendChatMessage(cmd);
mc.player.sendChatMessage(cmd);
break;
case 4 :
try {
@@ -213,7 +213,7 @@ public class GuiLexiconEntry extends GuiLexicon implements IGuiLexiconEntry, IPa
tutorial.poll();
positionTutorialArrow();
if(tutorial.isEmpty()) {
mc.thePlayer.addChatMessage(new TextComponentTranslation("botaniamisc.tutorialEnded").setStyle(new Style().setColor(TextFormatting.RED)));
mc.player.sendMessage(new TextComponentTranslation("botaniamisc.tutorialEnded").setStyle(new Style().setColor(TextFormatting.RED)));
hasTutorialArrow = false;
}
}
@@ -43,7 +43,7 @@ public class ModelTeruTeruBozu extends ModelBase {
public void render() {
float f5 = 1F / 16F;
if(Minecraft.getMinecraft().theWorld.isRaining())
if(Minecraft.getMinecraft().world.isRaining())
sadFace.render(f5);
else happyFace.render(f5);
thread.render(f5);
@@ -148,8 +148,8 @@ public class PlatformModel implements IBakedModel {
@Nonnull
@Override
public Biome getBiomeGenForCoords(@Nonnull BlockPos pos) {
return compose.getBiomeGenForCoords(pos);
public Biome getBiome(@Nonnull BlockPos pos) {
return compose.getBiome(pos);
}
@Override
@@ -76,7 +76,7 @@ public class RenderCorporeaSpark extends RenderSparkBase<EntityCorporeaSpark> {
GlStateManager.translate(0F, 0F, -2F + (time < 0 ? -absTime : absTime) / 6);
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
TextureAtlasSprite icon = Minecraft.getMinecraft().getRenderItem().getItemModelWithOverrides(stack, entity.worldObj, null).getParticleTexture();
TextureAtlasSprite icon = Minecraft.getMinecraft().getRenderItem().getItemModelWithOverrides(stack, entity.world, null).getParticleTexture();
if(icon != null) {
float minU = icon.getMinU();
@@ -170,7 +170,7 @@ public class RenderTileCorporeaCrystalCube extends TileEntitySpecialRenderer<Til
BlockPos pos = te.getPos();
IBlockAccess world = MinecraftForgeClient.getRegionRenderCache(te.getWorld(), pos);
IBlockState state = world.getBlockState(pos);
if(state.getPropertyNames().contains(Properties.StaticProperty))
if(state.getPropertyKeys().contains(Properties.StaticProperty))
{
state = state.withProperty(Properties.StaticProperty, false);
}
@@ -63,7 +63,7 @@ public class RenderTileGaiaHead extends TileEntitySkullRenderer {
profile = ((EntityPlayer) mc.getRenderViewEntity()).getGameProfile();
} else if (view instanceof EntitySkeleton) {
skullType = 0;
if (((EntitySkeleton) view).func_189771_df() == SkeletonType.WITHER)
if (((EntitySkeleton) view).getSkeletonType() == SkeletonType.WITHER)
skullType = 1;
} else if(view instanceof EntityWither)
skullType = 1;
@@ -21,8 +21,8 @@ public final class SkyblockRenderEvents {
@SubscribeEvent
public static void onRender(RenderWorldLastEvent event) {
World world = Minecraft.getMinecraft().theWorld;
if(ConfigHandler.enableFancySkybox && world.provider.getDimension() == 0 && (ConfigHandler.enableFancySkyboxInNormalWorlds || WorldTypeSkyblock.isWorldSkyblock(Minecraft.getMinecraft().theWorld))) {
World world = Minecraft.getMinecraft().world;
if(ConfigHandler.enableFancySkybox && world.provider.getDimension() == 0 && (ConfigHandler.enableFancySkyboxInNormalWorlds || WorldTypeSkyblock.isWorldSkyblock(Minecraft.getMinecraft().world))) {
if(!(world.provider.getSkyRenderer() instanceof SkyblockSkyRenderer))
world.provider.setSkyRenderer(new SkyblockSkyRenderer());
}
@@ -66,8 +66,8 @@ public class SkyblockSkyRenderer extends IRenderHandler {
// Botania - darken when in void
float insideVoid = 0;
if(mc.thePlayer.posY <= -2)
insideVoid = (float) Math.min(1F, -(mc.thePlayer.posY + 2) / 30F);
if(mc.player.posY <= -2)
insideVoid = (float) Math.min(1F, -(mc.player.posY + 2) / 30F);
f = Math.max(0F, f - insideVoid);
f1 = Math.max(0F, f1 - insideVoid);
@@ -346,7 +346,7 @@ public class SkyblockSkyRenderer extends IRenderHandler {
f16 *= Math.max(0.1F, effCelAng * 2);
renderStars(mc, f16, partialTicks);
}
/*float f15 = this.theWorld.getStarBrightness(partialTicks) * f16;
/*float f15 = this.world.getStarBrightness(partialTicks) * f16;
if (f15 > 0.0F)
{
@@ -375,7 +375,7 @@ public class SkyblockSkyRenderer extends IRenderHandler {
// Botania - no horizon rendering
/* GlStateManager.disableTexture2D();
GlStateManager.color(0.0F, 0.0F, 0.0F);
double d0 = this.mc.thePlayer.getPositionEyes(partialTicks).yCoord - this.theWorld.getHorizon();
double d0 = this.mc.player.getPositionEyes(partialTicks).yCoord - this.world.getHorizon();
if (d0 < 0.0D)
{
@@ -424,7 +424,7 @@ public class SkyblockSkyRenderer extends IRenderHandler {
tessellator.draw();
}
if (this.theWorld.provider.isSkyColored())
if (this.world.provider.isSkyColored())
{
GlStateManager.color(f * 0.2F + 0.04F, f1 * 0.2F + 0.04F, f2 * 0.6F + 0.1F);
}
@@ -44,7 +44,7 @@ public abstract class BlockCamo extends BlockMod {
&& Block.getBlockFromItem(currentStack.getItem()) != null
&& tile instanceof TileCamo) {
TileCamo camo = (TileCamo) tile;
IBlockState changeState = Block.getBlockFromItem(currentStack.getItem()).onBlockPlaced(world, pos, side, hitX, hitY, hitZ, currentStack.getItemDamage(), player);
IBlockState changeState = Block.getBlockFromItem(currentStack.getItem()).getStateForPlacement(world, pos, side, hitX, hitY, hitZ, currentStack.getItemDamage(), player);
if(isValidBlock(changeState) && !(changeState.getBlock() instanceof BlockCamo) && changeState.getMaterial() != Material.AIR) {
camo.camoState = changeState;
@@ -38,7 +38,7 @@ public class BlockFakeAir extends BlockMod {
private static final AxisAlignedBB AABB = new AxisAlignedBB(0, 0, 0, 0, 0, 0);
public BlockFakeAir() {
super(Material.field_189963_J, LibBlockNames.FAKE_AIR);
super(Material.STRUCTURE_VOID, LibBlockNames.FAKE_AIR);
setTickRandomly(true);
}
@@ -82,7 +82,7 @@ public class BlockFelPumpkin extends BlockMod implements ILexiconable {
EntityBlaze blaze = new EntityBlaze(world);
blaze.setLocationAndAngles(pos.getX() + 0.5D, pos.getY() - 1.95D, pos.getZ() + 0.5D, 0.0F, 0.0F);
blaze.getEntityData().setBoolean(TAG_FEL_SPAWNED, true);
world.spawnEntityInWorld(blaze);
world.spawnEntity(blaze);
world.notifyNeighborsOfStateChange(pos, Blocks.AIR);
world.notifyNeighborsOfStateChange(pos.down(), Blocks.AIR);
world.notifyNeighborsOfStateChange(pos.down(2), Blocks.AIR);
@@ -98,7 +98,7 @@ public class BlockFelPumpkin extends BlockMod implements ILexiconable {
public static void onDrops(LivingDropsEvent event) {
if(event.getEntityLiving() instanceof EntityBlaze && event.getEntityLiving().getEntityData().getBoolean(TAG_FEL_SPAWNED))
if(event.getDrops().isEmpty())
event.getDrops().add(new EntityItem(event.getEntityLiving().worldObj, event.getEntityLiving().posX, event.getEntityLiving().posY, event.getEntityLiving().posZ, new ItemStack(Items.BLAZE_POWDER, 6)));
event.getDrops().add(new EntityItem(event.getEntityLiving().world, event.getEntityLiving().posX, event.getEntityLiving().posY, event.getEntityLiving().posZ, new ItemStack(Items.BLAZE_POWDER, 6)));
else for(EntityItem item : event.getDrops()) {
ItemStack stack = item.getEntityItem();
if(stack.getItem() == Items.BLAZE_ROD)
@@ -75,9 +75,9 @@ public class BlockGhostRail extends BlockRailBase implements ILexiconable, IMode
@SubscribeEvent
public static void onMinecartUpdate(MinecartUpdateEvent event) {
BlockPos entPos = new BlockPos(event.getEntity());
IBlockState state = event.getEntity().worldObj.getBlockState(entPos);
IBlockState state = event.getEntity().world.getBlockState(entPos);
Block block = state.getBlock();
boolean air = block.isAir(state, event.getEntity().worldObj, entPos);
boolean air = block.isAir(state, event.getEntity().world, entPos);
int floatTicks = event.getEntity().getEntityData().getInteger(TAG_FLOAT_TICKS);
if(block == ModBlocks.ghostRail)
@@ -85,21 +85,21 @@ public class BlockGhostRail extends BlockRailBase implements ILexiconable, IMode
else if(block instanceof BlockRailBase || block == ModBlocks.dreamwood) {
event.getEntity().getEntityData().setInteger(TAG_FLOAT_TICKS, 0);
if(floatTicks > 0)
event.getEntity().worldObj.playEvent(2003, entPos, 0);
event.getEntity().world.playEvent(2003, entPos, 0);
}
floatTicks = event.getEntity().getEntityData().getInteger(TAG_FLOAT_TICKS);
if(floatTicks > 0) {
IBlockState stateBelow = event.getEntity().worldObj.getBlockState(entPos.down());
IBlockState stateBelow = event.getEntity().world.getBlockState(entPos.down());
Block blockBelow = stateBelow.getBlock();
boolean airBelow = blockBelow.isAir(stateBelow, event.getEntity().worldObj, entPos.down());
boolean airBelow = blockBelow.isAir(stateBelow, event.getEntity().world, entPos.down());
if(air && airBelow || !air && !airBelow)
event.getEntity().noClip = true;
event.getEntity().motionY = 0.2;
event.getEntity().motionX *= 1.4;
event.getEntity().motionZ *= 1.4;
event.getEntity().getEntityData().setInteger(TAG_FLOAT_TICKS, floatTicks - 1);
event.getEntity().worldObj.playEvent(2000, entPos, 0);
event.getEntity().world.playEvent(2000, entPos, 0);
} else event.getEntity().noClip = false;
}
@@ -98,8 +98,8 @@ public class BlockHourglass extends BlockMod implements IManaTrigger, IWandable,
return false;
if(hourglass.lock) {
if(!player.worldObj.isRemote)
player.addChatMessage(new TextComponentTranslation("botaniamisc.hourglassLock"));
if(!player.world.isRemote)
player.sendMessage(new TextComponentTranslation("botaniamisc.hourglassLock"));
return true;
}
@@ -44,7 +44,7 @@ public class BlockManaBomb extends BlockMod implements IManaTrigger, ILexiconabl
world.setBlockToAir(pos);
EntityManaStorm storm = new EntityManaStorm(world);
storm.setPosition(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5);
world.spawnEntityInWorld(storm);
world.spawnEntity(storm);
}
}
@@ -222,7 +222,7 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl
world.setBlockState(pos.offset(dir), ModBlocks.pistonRelay.getDefaultState());
else if(!world.isRemote) {
ItemStack stack = new ItemStack(ModBlocks.pistonRelay);
world.spawnEntityInWorld(new EntityItem(world, x + dir.getFrontOffsetX(), y + dir.getFrontOffsetY(), z + dir.getFrontOffsetZ(), stack));
world.spawnEntity(new EntityItem(world, x + dir.getFrontOffsetX(), y + dir.getFrontOffsetY(), z + dir.getFrontOffsetZ(), stack));
}
checkedCoords.add(s);
newPos = new DimWithPos(world.provider.getDimension(), pos.offset(dir));
@@ -89,7 +89,7 @@ public class BlockStorage extends BlockMod implements ILexiconable {
}
@Override
public boolean isBeaconBase(IBlockAccess worldObj, BlockPos pos, BlockPos beaconPos) {
public boolean isBeaconBase(IBlockAccess world, BlockPos pos, BlockPos beaconPos) {
return true;
}
@@ -76,15 +76,15 @@ public class BlockCorporeaIndex extends BlockCorporeaBase implements ILexiconabl
}
@Override
public boolean addLandingEffects(IBlockState state, net.minecraft.world.WorldServer worldObj, BlockPos blockPosition, IBlockState iblockstate, EntityLivingBase entity, int numberOfParticles )
public boolean addLandingEffects(IBlockState state, net.minecraft.world.WorldServer world, BlockPos blockPosition, IBlockState iblockstate, EntityLivingBase entity, int numberOfParticles )
{
float f = MathHelper.ceiling_float_int(entity.fallDistance - 3.0F);
float f = MathHelper.ceil(entity.fallDistance - 3.0F);
double d0 = Math.min(0.2F + f / 15.0F, 10.0F);
if (d0 > 2.5D) {
d0 = 2.5D;
}
int i = (int)(150.0D * d0);
worldObj.spawnParticle(EnumParticleTypes.BLOCK_DUST, entity.posX, entity.posY, entity.posZ, i, 0.0D, 0.0D, 0.0D, 0.15000000596046448D, Block.getStateId(ModBlocks.storage.getDefaultState().withProperty(BotaniaStateProps.STORAGE_VARIANT, StorageVariant.ELEMENTIUM)));
world.spawnParticle(EnumParticleTypes.BLOCK_DUST, entity.posX, entity.posY, entity.posZ, i, 0.0D, 0.0D, 0.0D, 0.15000000596046448D, Block.getStateId(ModBlocks.storage.getDefaultState().withProperty(BotaniaStateProps.STORAGE_VARIANT, StorageVariant.ELEMENTIUM)));
return true;
}
@@ -101,7 +101,7 @@ public class BlockCorporeaIndex extends BlockCorporeaBase implements ILexiconabl
double d0 = pos.getX() + (j + 0.5D) / i;
double d1 = pos.getY() + (k + 0.5D) / i;
double d2 = pos.getZ() + (l + 0.5D) / i;
effectRenderer.addEffect(factory.getEntityFX(-1, world, d0, d1, d2, d0 - pos.getX() - 0.5D, d1 - pos.getY() - 0.5D, d2 - pos.getZ() - 0.5D, Block.getStateId(ModBlocks.storage.getDefaultState().withProperty(BotaniaStateProps.STORAGE_VARIANT, StorageVariant.ELEMENTIUM))));
effectRenderer.addEffect(factory.createParticle(-1, world, d0, d1, d2, d0 - pos.getX() - 0.5D, d1 - pos.getY() - 0.5D, d2 - pos.getZ() - 0.5D, Block.getStateId(ModBlocks.storage.getDefaultState().withProperty(BotaniaStateProps.STORAGE_VARIANT, StorageVariant.ELEMENTIUM))));
}
}
}
@@ -89,7 +89,7 @@ public class BlockSpecialQuartz extends BlockMod implements ILexiconable {
@Nonnull
@Override
public IBlockState onBlockPlaced(World world, BlockPos pos, EnumFacing side, float par6, float par7, float par8, int meta, EntityLivingBase placer) {
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing side, float par6, float par7, float par8, int meta, EntityLivingBase placer) {
if (meta == 2) { // Pillar quartz variant
switch (side.getAxis()) {
case Y:
@@ -114,7 +114,7 @@ public class BlockSpecialQuartz extends BlockMod implements ILexiconable {
}
@Override
public ItemStack createStackedBlock(@Nonnull IBlockState state) {
public ItemStack getSilkTouchDrop(@Nonnull IBlockState state) {
return new ItemStack(this, 1, damageDropped(state));
}
@@ -92,7 +92,7 @@ public class BlockSpecialQuartzSlab extends BlockModSlab {
}
@Override
public ItemStack createStackedBlock(@Nonnull IBlockState par1) {
public ItemStack getSilkTouchDrop(@Nonnull IBlockState par1) {
return new ItemStack(getSingleBlock());
}
@@ -96,7 +96,7 @@ public abstract class BlockModSlab extends BlockSlab implements ILexiconable, IM
}
@Override
public ItemStack createStackedBlock(@Nonnull IBlockState par1) {
public ItemStack getSilkTouchDrop(@Nonnull IBlockState par1) {
return new ItemStack(getSingleBlock());
}
@@ -37,7 +37,7 @@ public class BehaviourCocoaBeans extends BehaviorDefaultDispenseItem {
public ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack) {
if(par2ItemStack.getItemDamage() == EnumDyeColor.BROWN.getDyeDamage()) {
Block block = Blocks.COCOA;
EnumFacing facing = par1IBlockSource.func_189992_e().getValue(BlockDispenser.FACING);
EnumFacing facing = par1IBlockSource.getBlockState().getValue(BlockDispenser.FACING);
BlockPos pos = par1IBlockSource.getBlockPos().offset(facing);
World world = par1IBlockSource.getWorld();
@@ -53,7 +53,7 @@ public class BehaviourPoolMinecart extends BehaviorDefaultDispenseItem {
if(stack.hasDisplayName())
entityminecart.setCustomNameTag(stack.getDisplayName());
world.spawnEntityInWorld(entityminecart);
world.spawnEntity(entityminecart);
stack.splitStack(1);
return stack;
}
@@ -29,7 +29,7 @@ public class BehaviourSeeds extends BehaviorDefaultDispenseItem {
@Override
public ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack) {
EnumFacing facing = par1IBlockSource.func_189992_e().getValue(BlockDispenser.FACING);
EnumFacing facing = par1IBlockSource.getBlockState().getValue(BlockDispenser.FACING);
BlockPos pos = par1IBlockSource.getBlockPos().offset(facing);
World world = par1IBlockSource.getWorld();
@@ -147,7 +147,7 @@ public class BlockEnchanter extends BlockMod implements IWandable, ILexiconable,
float f1 = random.nextFloat() * 0.8F + 0.1F;
EntityItem entityitem;
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; world.spawnEntityInWorld(entityitem)) {
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; world.spawnEntity(entityitem)) {
int k1 = random.nextInt(21) + 10;
if (k1 > itemstack.stackSize)
@@ -53,7 +53,7 @@ public class BlockTerraPlate extends BlockMod implements ILexiconable {
}
@Override
public boolean onBlockActivated(World worldObj, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing s, float xs, float ys, float zs) {
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing s, float xs, float ys, float zs) {
if(stack != null && stack.getItem() == ModItems.manaResource && stack.getItemDamage() < 3) {
if(player == null || !player.capabilities.isCreativeMode) {
stack.stackSize--;
@@ -63,11 +63,11 @@ public class BlockTerraPlate extends BlockMod implements ILexiconable {
ItemStack target = stack.copy();
target.stackSize = 1;
EntityItem item = new EntityItem(worldObj, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, target);
EntityItem item = new EntityItem(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, target);
item.setPickupDelay(40);
item.motionX = item.motionY = item.motionZ = 0;
if(!worldObj.isRemote)
worldObj.spawnEntityInWorld(item);
if(!world.isRemote)
world.spawnEntity(item);
return true;
}
@@ -46,7 +46,7 @@ public class SubTileClayconia extends SubTileFunctional {
if(ConfigHandler.blockBreakParticles)
supertile.getWorld().playEvent(2001, coords, Block.getStateId(Blocks.SAND.getDefaultState()));
EntityItem item = new EntityItem(supertile.getWorld(), coords.getX() + 0.5, coords.getY() + 0.5, coords.getZ() + 0.5, new ItemStack(Items.CLAY_BALL));
supertile.getWorld().spawnEntityInWorld(item);
supertile.getWorld().spawnEntity(item);
mana -= COST;
}
}
@@ -108,7 +108,7 @@ public class SubTileDaffomill extends SubTileFunctional {
return false;
if(player.isSneaking()) {
if(!player.worldObj.isRemote) {
if(!player.world.isRemote) {
orientation = orientation.rotateY();
sync();
}
@@ -65,7 +65,7 @@ public class SubTileHeiseiDream extends SubTileFunctional {
if(target == null || !(target instanceof IMob)) {
IMob newTarget;
do newTarget = mobs.get(entity.worldObj.rand.nextInt(mobs.size()));
do newTarget = mobs.get(entity.world.rand.nextInt(mobs.size()));
while(newTarget == entity);
if(newTarget instanceof EntityLiving) {
@@ -38,7 +38,7 @@ public class SubTileHyacidus extends SubTileFunctional {
List<EntityLivingBase> entities = supertile.getWorld().getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1)));
for(EntityLivingBase entity : entities) {
if(!(entity instanceof EntityPlayer) && entity.getActivePotionEffect(MobEffects.POISON) == null && mana >= cost && !entity.worldObj.isRemote && entity.getCreatureAttribute() != EnumCreatureAttribute.UNDEAD) {
if(!(entity instanceof EntityPlayer) && entity.getActivePotionEffect(MobEffects.POISON) == null && mana >= cost && !entity.world.isRemote && entity.getCreatureAttribute() != EnumCreatureAttribute.UNDEAD) {
entity.addPotionEffect(new PotionEffect(MobEffects.POISON, 60, 0));
mana -= cost;
}
@@ -89,7 +89,7 @@ public class SubTileLoonuim extends SubTileFunctional {
pos = pos.up();
if(pos.getY() >= 254)
return;
} while(world.getBlockState(pos).getBlock().isVisuallyOpaque());
} while(world.getBlockState(pos).getBlock().causesSuffocation());
pos = pos.up();
double x = pos.getX() + Math.random();
@@ -108,12 +108,12 @@ public class SubTileLoonuim extends SubTileFunctional {
case 0:
entity = new EntityZombie(world);
if(world.rand.nextInt(10) == 0)
((EntityZombie) entity).func_189778_a(ZombieType.HUSK); // set zombie type
((EntityZombie) entity).setZombieType(ZombieType.HUSK);
break;
case 1:
entity = new EntitySkeleton(world);
if(world.rand.nextInt(10) == 0)
((EntitySkeleton) entity).func_189768_a(SkeletonType.STRAY); // set skeleton type
((EntitySkeleton) entity).setSkeletonType(SkeletonType.STRAY);
break;
case 2:
if(world.rand.nextInt(10) == 0)
@@ -126,8 +126,8 @@ public class SubTileLoonuim extends SubTileFunctional {
entity.motionX = entity.motionY = entity.motionZ = 0;
Multimap map = HashMultimap.create();
map.put(SharedMonsterAttributes.MAX_HEALTH.getAttributeUnlocalizedName(), new AttributeModifier("Loonium Modififer Health", 2, 1));
map.put(SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(), new AttributeModifier("Loonium Modififer Damage", 1.5, 1));
map.put(SharedMonsterAttributes.MAX_HEALTH.getName(), new AttributeModifier("Loonium Modififer Health", 2, 1));
map.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier("Loonium Modififer Damage", 1.5, 1));
entity.getAttributeMap().applyAttributeModifiers(map);
entity.addPotionEffect(new PotionEffect(MobEffects.FIRE_RESISTANCE, Integer.MAX_VALUE, 0));
@@ -137,7 +137,7 @@ public class SubTileLoonuim extends SubTileFunctional {
stack.writeToNBT(cmp);
entity.getEntityData().setTag(TAG_ITEMSTACK_TO_DROP, cmp);
world.spawnEntityInWorld(entity);
world.spawnEntity(entity);
entity.onInitialSpawn(world.getDifficultyForLocation(pos), null);
SubTileSpectranthemum.spawnExplosionParticles(entity, 5);
@@ -193,7 +193,7 @@ public class SubTileLoonuim extends SubTileFunctional {
NBTTagCompound cmp = e.getEntityData().getCompoundTag(TAG_ITEMSTACK_TO_DROP);
ItemStack stack = ItemStack.loadItemStackFromNBT(cmp);
event.getDrops().clear();
event.getDrops().add(new EntityItem(e.worldObj, e.posX, e.posY, e.posZ, stack));
event.getDrops().add(new EntityItem(e.world, e.posX, e.posY, e.posZ, stack));
}
}
@@ -75,7 +75,7 @@ public class SubTileMarimorphosis extends SubTileFunctional {
}
public ItemStack getStoneToPut(BlockPos coords) {
List<Type> types = Arrays.asList(BiomeDictionary.getTypesForBiome(supertile.getWorld().getBiomeGenForCoords(coords)));
List<Type> types = Arrays.asList(BiomeDictionary.getTypesForBiome(supertile.getWorld().getBiome(coords)));
TIntArrayList values = new TIntArrayList();
for(int i = 0; i < 8; i++) {
@@ -45,7 +45,7 @@ public class SubTileSolegnolia extends SubTileFunctional {
public static boolean hasSolegnoliaAround(Entity e) {
return existingFlowers.stream()
.filter(f -> f.redstoneSignal == 0)
.filter(f -> f.supertile.getWorld() == e.worldObj)
.filter(f -> f.supertile.getWorld() == e.world)
.filter(f -> f.supertile.getWorld().getTileEntity(f.supertile.getPos()) == f.supertile)
.filter(f -> f.supertile.getDistanceSq(e.posX, e.posY, e.posZ) <= f.getRange() * f.getRange())
.findAny().isPresent();
@@ -95,7 +95,7 @@ public class SubTileSpectranthemum extends SubTileFunctional {
}
static void spawnExplosionParticles(Entity item, int p) {
PacketHandler.sendToNearby(item.worldObj, new BlockPos(item), new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.ITEM_SMOKE, item.posX, item.posY, item.posZ, item.getEntityId(), p));
PacketHandler.sendToNearby(item.world, new BlockPos(item), new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.ITEM_SMOKE, item.posX, item.posY, item.posZ, item.getEntityId(), p));
}
@Override
@@ -153,7 +153,7 @@ public class SubTileSpectranthemum extends SubTileFunctional {
@Override
@SideOnly(Side.CLIENT)
public BlockPos getBinding() {
return Minecraft.getMinecraft().thePlayer.isSneaking() && bindPos.getY() != -1 ? bindPos : super.getBinding();
return Minecraft.getMinecraft().player.isSneaking() && bindPos.getY() != -1 ? bindPos : super.getBinding();
}
@Override
@@ -79,7 +79,7 @@ public class SubTileVinculotus extends SubTileFunctional {
if(event.getEntityLiving() instanceof EntityEnderman) {
List<SubTileVinculotus> possibleFlowers = new ArrayList<>();
for(SubTileVinculotus flower : existingFlowers) {
if(flower.redstoneSignal > 0 || flower.mana <= cost || flower.supertile.getWorld() != event.getEntityLiving().worldObj || flower.supertile.getWorld().getTileEntity(flower.supertile.getPos()) != flower.supertile)
if(flower.redstoneSignal > 0 || flower.mana <= cost || flower.supertile.getWorld() != event.getEntityLiving().world || flower.supertile.getWorld().getTileEntity(flower.supertile.getPos()) != flower.supertile)
continue;
double x = flower.supertile.getPos().getX() + 0.5;
@@ -91,7 +91,7 @@ public class SubTileVinculotus extends SubTileFunctional {
}
if(!possibleFlowers.isEmpty()) {
SubTileVinculotus flower = possibleFlowers.get(event.getEntityLiving().worldObj.rand.nextInt(possibleFlowers.size()));
SubTileVinculotus flower = possibleFlowers.get(event.getEntityLiving().world.rand.nextInt(possibleFlowers.size()));
double x = flower.supertile.getPos().getX() + 0.5;
double y = flower.supertile.getPos().getY() + 1.5;
@@ -74,8 +74,8 @@ public class SubTileEndoflame extends SubTileGenerating {
didSomething = true;
} else {
item.worldObj.spawnParticle(EnumParticleTypes.SMOKE_LARGE, item.posX, item.posY + 0.1, item.posZ, 0.0D, 0.0D, 0.0D);
item.worldObj.spawnParticle(EnumParticleTypes.FLAME, item.posX, item.posY, item.posZ, 0.0D, 0.0D, 0.0D);
item.world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, item.posX, item.posY + 0.1, item.posZ, 0.0D, 0.0D, 0.0D);
item.world.spawnParticle(EnumParticleTypes.FLAME, item.posX, item.posY, item.posZ, 0.0D, 0.0D, 0.0D);
}
@@ -179,7 +179,7 @@ public class SubTileHydroangeas extends SubTileGenerating {
@Override
public int getDelayBetweenPassiveGeneration() {
boolean rain = supertile.getWorld().getBiomeGenForCoords(supertile.getPos()).getRainfall() > 0 && (supertile.getWorld().isRaining() || supertile.getWorld().isThundering());
boolean rain = supertile.getWorld().getBiome(supertile.getPos()).getRainfall() > 0 && (supertile.getWorld().isRaining() || supertile.getWorld().isThundering());
return rain ? 2 : 3;
}
@@ -45,7 +45,7 @@ public class SubTileNarslimmus extends SubTileGenerating {
int size = slime.getSlimeSize();
int mul = (int) Math.pow(2, size);
int mana = 820 * mul;
if(!slime.worldObj.isRemote) {
if(!slime.world.isRemote) {
slime.setDead();
slime.playSound(size > 1 ? SoundEvents.ENTITY_SLIME_SQUISH : SoundEvents.ENTITY_SMALL_SLIME_SQUISH, 1, 0.02F);
this.mana = Math.min(getMaxMana(), this.mana + mana);
@@ -53,12 +53,12 @@ public class SubTileNarslimmus extends SubTileGenerating {
}
for (int j = 0; j < mul * 8; ++j) {
float f = slime.worldObj.rand.nextFloat() * (float)Math.PI * 2.0F;
float f1 = slime.worldObj.rand.nextFloat() * 0.5F + 0.5F;
float f = slime.world.rand.nextFloat() * (float)Math.PI * 2.0F;
float f1 = slime.world.rand.nextFloat() * 0.5F + 0.5F;
float f2 = MathHelper.sin(f) * size * 0.5F * f1;
float f3 = MathHelper.cos(f) * size * 0.5F * f1;
float f4 = slime.worldObj.rand.nextFloat() * size * 0.5F * f1;
slime.worldObj.spawnParticle(EnumParticleTypes.SLIME, slime.posX + f2, slime.getEntityBoundingBox().minY + f4, slime.posZ + f3, 0.0D, 0.0D, 0.0D);
float f4 = slime.world.rand.nextFloat() * size * 0.5F * f1;
slime.world.spawnParticle(EnumParticleTypes.SLIME, slime.posX + f2, slime.getEntityBoundingBox().minY + f4, slime.posZ + f3, 0.0D, 0.0D, 0.0D);
}
break;
}
@@ -90,7 +90,7 @@ public class SubTileNarslimmus extends SubTileGenerating {
@SubscribeEvent
public static void onSpawn(LivingSpawnEvent.CheckSpawn event) {
if(event.getEntityLiving() instanceof EntitySlime && event.getResult() != Result.DENY && isSlimeChunk(event.getEntityLiving().worldObj, MathHelper.floor_double(event.getX()), MathHelper.floor_double(event.getZ())))
if(event.getEntityLiving() instanceof EntitySlime && event.getResult() != Result.DENY && isSlimeChunk(event.getEntityLiving().world, MathHelper.floor(event.getX()), MathHelper.floor(event.getZ())))
event.getEntityLiving().getEntityData().setBoolean(TAG_WORLD_SPAWNED, true);
}
@@ -101,7 +101,7 @@ public class TileAlfPortal extends TileMod {
@Override
public void update() {
IBlockState iBlockState = worldObj.getBlockState(getPos());
IBlockState iBlockState = world.getBlockState(getPos());
if(iBlockState.getValue(BotaniaStateProps.ALFPORTAL_STATE) == AlfPortalState.OFF) {
ticksOpen = 0;
return;
@@ -121,8 +121,8 @@ public class TileAlfPortal extends TileMod {
if(ConfigHandler.elfPortalParticlesEnabled)
blockParticle(state);
List<EntityItem> items = worldObj.getEntitiesWithinAABB(EntityItem.class, aabb);
if(!worldObj.isRemote)
List<EntityItem> items = world.getEntitiesWithinAABB(EntityItem.class, aabb);
if(!world.isRemote)
for(EntityItem item : items) {
if(item.isDead)
continue;
@@ -147,13 +147,13 @@ public class TileAlfPortal extends TileMod {
}
if(ticksSinceLastItem >= 4) {
if(!worldObj.isRemote)
if(!world.isRemote)
resolveRecipes();
}
}
if(closeNow) {
worldObj.setBlockState(getPos(), ModBlocks.alfPortal.getDefaultState(), 1 | 2);
world.setBlockState(getPos(), ModBlocks.alfPortal.getDefaultState(), 1 | 2);
for(int i = 0; i < 36; i++)
blockParticle(state);
closeNow = false;
@@ -161,12 +161,12 @@ public class TileAlfPortal extends TileMod {
if(newState == AlfPortalState.OFF)
for(int i = 0; i < 36; i++)
blockParticle(state);
worldObj.setBlockState(getPos(), worldObj.getBlockState(getPos()).withProperty(BotaniaStateProps.ALFPORTAL_STATE, newState), 1 | 2);
world.setBlockState(getPos(), world.getBlockState(getPos()).withProperty(BotaniaStateProps.ALFPORTAL_STATE, newState), 1 | 2);
}
}
private void blockParticle(AlfPortalState state) {
int i = worldObj.rand.nextInt(AIR_POSITIONS.length);
int i = world.rand.nextInt(AIR_POSITIONS.length);
double[] pos = new double[] {
AIR_POSITIONS[i].getX() + 0.5F, AIR_POSITIONS[i].getY() + 0.5F, AIR_POSITIONS[i].getZ() + 0.5F
};
@@ -178,11 +178,11 @@ public class TileAlfPortal extends TileMod {
}
public boolean onWanded() {
AlfPortalState state = worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.ALFPORTAL_STATE);
AlfPortalState state = world.getBlockState(getPos()).getValue(BotaniaStateProps.ALFPORTAL_STATE);
if(state == AlfPortalState.OFF) {
AlfPortalState newState = getValidState();
if(newState != AlfPortalState.OFF) {
worldObj.setBlockState(getPos(), worldObj.getBlockState(getPos()).withProperty(BotaniaStateProps.ALFPORTAL_STATE, newState), 1 | 2);
world.setBlockState(getPos(), world.getBlockState(getPos()).withProperty(BotaniaStateProps.ALFPORTAL_STATE, newState), 1 | 2);
return true;
}
}
@@ -192,7 +192,7 @@ public class TileAlfPortal extends TileMod {
private AxisAlignedBB getPortalAABB() {
AxisAlignedBB aabb = new AxisAlignedBB(pos.add(-1, 1, 0), pos.add(2, 4, 1));
if(worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.ALFPORTAL_STATE) == AlfPortalState.ON_X)
if(world.getBlockState(getPos()).getValue(BotaniaStateProps.ALFPORTAL_STATE) == AlfPortalState.ON_X)
aabb = new AxisAlignedBB(pos.add(0, 1, -1), pos.add(1, 4, 2));
return aabb;
@@ -234,9 +234,9 @@ public class TileAlfPortal extends TileMod {
}
private void spawnItem(ItemStack stack) {
EntityItem item = new EntityItem(worldObj, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, stack);
EntityItem item = new EntityItem(world, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, stack);
item.getEntityData().setBoolean(TAG_PORTAL_FLAG, true);
worldObj.spawnEntityInWorld(item);
world.spawnEntity(item);
ticksSinceLastItem = 0;
}
@@ -337,7 +337,7 @@ public class TileAlfPortal extends TileMod {
List<BlockPos> pylons = locatePylons();
for(BlockPos pos : pylons) {
TileEntity tile = worldObj.getTileEntity(getPos().add(pos));
TileEntity tile = world.getTileEntity(getPos().add(pos));
if(tile instanceof TilePylon) {
TilePylon pylon = (TilePylon) tile;
pylon.activated = true;
@@ -365,21 +365,21 @@ public class TileAlfPortal extends TileMod {
int expectedConsumption = costPer * pylons.size();
for(BlockPos pos : pylons) {
TileEntity tile = worldObj.getTileEntity(getPos().add(pos));
TileEntity tile = world.getTileEntity(getPos().add(pos));
if(tile instanceof TilePylon) {
TilePylon pylon = (TilePylon) tile;
pylon.activated = true;
pylon.centerPos = getPos();
}
tile = worldObj.getTileEntity(getPos().add(pos).down());
tile = world.getTileEntity(getPos().add(pos).down());
if(tile instanceof TilePool) {
TilePool pool = (TilePool) tile;
if(pool.getCurrentMana() < costPer) {
closeNow = closeNow || close;
return false;
} else if(!worldObj.isRemote) {
} else if(!world.isRemote) {
consumePools.add(pool);
consumed += costPer;
}
@@ -412,10 +412,10 @@ public class TileAlfPortal extends TileMod {
private boolean checkPosition(BlockPos pos, IBlockState state, boolean onlyCheckBlock) {
BlockPos pos_ = getPos().add(pos);
IBlockState stateat = worldObj.getBlockState(pos_);
IBlockState stateat = world.getBlockState(pos_);
Block blockat = stateat.getBlock();
if(state.getBlock() == Blocks.AIR ? blockat.isAir(stateat, worldObj, pos_) : blockat == state.getBlock())
if(state.getBlock() == Blocks.AIR ? blockat.isAir(stateat, world, pos_) : blockat == state.getBlock())
return onlyCheckBlock || stateat == state;
return false;
@@ -72,24 +72,24 @@ public class TileAltar extends TileSimpleInventory implements IPetalApothecary {
if(stack == null || item.isDead)
return false;
if(!isMossy && worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.ALTAR_VARIANT) == AltarVariant.DEFAULT) {
if(!isMossy && world.getBlockState(getPos()).getValue(BotaniaStateProps.ALTAR_VARIANT) == AltarVariant.DEFAULT) {
if(stack.getItem() == Item.getItemFromBlock(Blocks.VINE)) {
isMossy = true;
if (worldObj.isRemote) {
worldObj.markBlockRangeForRenderUpdate(getPos(), getPos());
if (world.isRemote) {
world.markBlockRangeForRenderUpdate(getPos(), getPos());
} else {
worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock());
world.updateComparatorOutputLevel(pos, world.getBlockState(pos).getBlock());
stack.stackSize--;
if(stack.stackSize == 0)
item.setDead();
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos);
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos);
}
return true;
}
}
if(!hasWater() && !hasLava() && !worldObj.isRemote) {
if(!hasWater() && !hasLava() && !world.isRemote) {
if(stack.hasCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, null)) {
IFluidHandler fluidHandler = stack.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, null);
@@ -99,12 +99,12 @@ public class TileAltar extends TileSimpleInventory implements IPetalApothecary {
if(drainWater != null && drainWater.getFluid() == FluidRegistry.WATER && drainWater.amount == Fluid.BUCKET_VOLUME) {
setWater(true);
worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock());
world.updateComparatorOutputLevel(pos, world.getBlockState(pos).getBlock());
fluidHandler.drain(new FluidStack(FluidRegistry.WATER, Fluid.BUCKET_VOLUME), true);
return true;
} else if(drainLava != null && drainLava.getFluid() == FluidRegistry.LAVA && drainLava.amount == Fluid.BUCKET_VOLUME) {
setLava(true);
worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock());
world.updateComparatorOutputLevel(pos, world.getBlockState(pos).getBlock());
fluidHandler.drain(new FluidStack(FluidRegistry.LAVA, Fluid.BUCKET_VOLUME), true);
return true;
}
@@ -124,7 +124,7 @@ public class TileAltar extends TileSimpleInventory implements IPetalApothecary {
if(itemHandler.getStackInSlot(getSizeInventory() - 1) != null)
return false;
if(!worldObj.isRemote) {
if(!world.isRemote) {
stack.stackSize--;
if(stack.stackSize == 0)
item.setDead();
@@ -135,7 +135,7 @@ public class TileAltar extends TileSimpleInventory implements IPetalApothecary {
stackToPut.stackSize = 1;
itemHandler.setStackInSlot(i, stackToPut);
didChange = true;
worldObj.playSound(null, pos, SoundEvents.ENTITY_GENERIC_SPLASH, SoundCategory.BLOCKS, 0.1F, 10F);
world.playSound(null, pos, SoundEvents.ENTITY_GENERIC_SPLASH, SoundCategory.BLOCKS, 0.1F, 10F);
break;
}
}
@@ -144,7 +144,7 @@ public class TileAltar extends TileSimpleInventory implements IPetalApothecary {
if(recipe.matches(itemHandler)) {
saveLastRecipe();
if(!worldObj.isRemote) {
if(!world.isRemote) {
for(int i = 0; i < getSizeInventory(); i++)
itemHandler.setStackInSlot(i, null);
@@ -153,11 +153,11 @@ public class TileAltar extends TileSimpleInventory implements IPetalApothecary {
item.setDead();
ItemStack output = recipe.getOutput().copy();
EntityItem outputItem = new EntityItem(worldObj, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, output);
worldObj.spawnEntityInWorld(outputItem);
EntityItem outputItem = new EntityItem(world, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, output);
world.spawnEntity(outputItem);
setWater(false);
worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock());
world.updateComparatorOutputLevel(pos, world.getBlockState(pos).getBlock());
}
craftingFanciness();
@@ -185,11 +185,11 @@ public class TileAltar extends TileSimpleInventory implements IPetalApothecary {
public void trySetLastRecipe(EntityPlayer player) {
tryToSetLastRecipe(player, itemHandler, lastRecipe);
if(!isEmpty())
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos);
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos);
}
public static void tryToSetLastRecipe(EntityPlayer player, IItemHandlerModifiable inv, List<ItemStack> lastRecipe) {
if(lastRecipe == null || lastRecipe.isEmpty() || player.worldObj.isRemote)
if(lastRecipe == null || lastRecipe.isEmpty() || player.world.isRemote)
return;
int index = 0;
@@ -217,7 +217,7 @@ public class TileAltar extends TileSimpleInventory implements IPetalApothecary {
if(didAny) {
if(inv instanceof TileAltar)
player.worldObj.playSound(null, ((TileAltar) inv).getPos(), SoundEvents.ENTITY_GENERIC_SPLASH, SoundCategory.BLOCKS, 0.1F, 10F);
player.world.playSound(null, ((TileAltar) inv).getPos(), SoundEvents.ENTITY_GENERIC_SPLASH, SoundCategory.BLOCKS, 0.1F, 10F);
if(player instanceof EntityPlayerMP) {
EntityPlayerMP mp = (EntityPlayerMP) player;
mp.inventoryContainer.detectAndSendChanges();
@@ -226,7 +226,7 @@ public class TileAltar extends TileSimpleInventory implements IPetalApothecary {
}
private void craftingFanciness() {
worldObj.playSound(null, pos, BotaniaSoundEvents.altarCraft, SoundCategory.BLOCKS, 1F, 1F);
world.playSound(null, pos, BotaniaSoundEvents.altarCraft, SoundCategory.BLOCKS, 1F, 1F);
for(int i = 0; i < 25; i++) {
float red = (float) Math.random();
float green = (float) Math.random();
@@ -245,14 +245,14 @@ public class TileAltar extends TileSimpleInventory implements IPetalApothecary {
@Override
public void update() {
List<EntityItem> items = worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos.add(0, 1D / 16D * 20D, 0), pos.add(1, 1D / 16D * 32D, 1)));
List<EntityItem> items = world.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos.add(0, 1D / 16D * 20D, 0), pos.add(1, 1D / 16D * 32D, 1)));
boolean didChange = false;
for(EntityItem item : items)
didChange = collideEntityItem(item) || didChange;
if(didChange)
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos);
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos);
for(int i = 0; i < getSizeInventory(); i++) {
ItemStack stackAt = itemHandler.getStackInSlot(i);
@@ -265,16 +265,16 @@ public class TileAltar extends TileSimpleInventory implements IPetalApothecary {
float green = color.getGreen() / 255F;
float blue = color.getBlue() / 255F;
if(Math.random() >= 0.75F)
worldObj.playSound(null, pos, SoundEvents.ENTITY_GENERIC_SPLASH, SoundCategory.BLOCKS, 0.1F, 10F);
world.playSound(null, pos, SoundEvents.ENTITY_GENERIC_SPLASH, SoundCategory.BLOCKS, 0.1F, 10F);
Botania.proxy.sparkleFX(pos.getX() + 0.5 + Math.random() * 0.4 - 0.2, pos.getY() + 1, pos.getZ() + 0.5 + Math.random() * 0.4 - 0.2, red, green, blue, (float) Math.random(), 10);
}
}
if(hasLava()) {
isMossy = false;
worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, pos.getX() + 0.5 + Math.random() * 0.4 - 0.2, pos.getY() + 1, pos.getZ() + 0.5 + Math.random() * 0.4 - 0.2, 0, 0.05, 0);
world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, pos.getX() + 0.5 + Math.random() * 0.4 - 0.2, pos.getY() + 1, pos.getZ() + 0.5 + Math.random() * 0.4 - 0.2, 0, 0.05, 0);
if(Math.random() > 0.9)
worldObj.spawnParticle(EnumParticleTypes.LAVA, pos.getX() + 0.5 + Math.random() * 0.4 - 0.2, pos.getY() + 1, pos.getZ() + 0.5 + Math.random() * 0.4 - 0.2, 0, 0.01, 0);
world.spawnParticle(EnumParticleTypes.LAVA, pos.getX() + 0.5 + Math.random() * 0.4 - 0.2, pos.getY() + 1, pos.getZ() + 0.5 + Math.random() * 0.4 - 0.2, 0, 0.01, 0);
}
if(recipeKeepTicks > 0)
@@ -318,12 +318,12 @@ public class TileAltar extends TileSimpleInventory implements IPetalApothecary {
@Override
public void setWater(boolean water) {
hasWater = water;
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos);
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos);
}
public void setLava(boolean lava) {
hasLava = lava;
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos);
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos);
}
@Override
@@ -52,8 +52,8 @@ public class TileAnimatedTorch extends TileMod {
@Override
public void onLoad() {
if(!worldObj.isRemote)
nextRandomRotation = worldObj.rand.nextInt(4);
if(!world.isRemote)
nextRandomRotation = world.rand.nextInt(4);
}
public void handRotate() {
@@ -63,8 +63,8 @@ public class TileAnimatedTorch extends TileMod {
public void toggle() {
rotateTo(torchMode.modeSwitcher.rotate(this, side));
if(!worldObj.isRemote) {
nextRandomRotation = worldObj.rand.nextInt(4);
if(!world.isRemote) {
nextRandomRotation = world.rand.nextInt(4);
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(this);
}
}
@@ -96,7 +96,7 @@ public class TileAnimatedTorch extends TileMod {
this.side = side;
rotating = true;
worldObj.notifyNeighborsOfStateChange(getPos(), getBlockType());
world.notifyNeighborsOfStateChange(getPos(), getBlockType());
}
@SideOnly(Side.CLIENT)
@@ -117,7 +117,7 @@ public class TileAnimatedTorch extends TileMod {
if(rotationTicks <= 0) {
rotating = false;
worldObj.notifyNeighborsOfStateChange(getPos(), getBlockType());
world.notifyNeighborsOfStateChange(getPos(), getBlockType());
}
} else rotation = side * 90;
@@ -128,7 +128,7 @@ public class TileAnimatedTorch extends TileMod {
double z = getPos().getZ() + 0.5 + Math.sin((rotation + 90) / 180.0 * Math.PI) * 0.35;
for(int i = 0; i < amt; i++)
worldObj.spawnParticle(EnumParticleTypes.REDSTONE, x, y, z, 0.0D, 0.0D, 0.0D, new int[0]);
world.spawnParticle(EnumParticleTypes.REDSTONE, x, y, z, 0.0D, 0.0D, 0.0D, new int[0]);
}
@Override
@@ -145,7 +145,7 @@ public class TileAnimatedTorch extends TileMod {
public void readPacketNBT(NBTTagCompound cmp) {
side = cmp.getInteger(TAG_SIDE);
rotating = cmp.getBoolean(TAG_ROTATING);
if(worldObj != null && !worldObj.isRemote)
if(world != null && !world.isRemote)
rotationTicks = cmp.getInteger(TAG_ROTATION_TICKS);
anglePerTick = cmp.getDouble(TAG_ANGLE_PER_TICK);
nextRandomRotation = cmp.getInteger(TAG_NEXT_RANDOM_ROTATION);
@@ -34,7 +34,7 @@ public class TileAvatar extends TileSimpleInventory implements IAvatarTile {
public void update() {
enabled = true;
for(EnumFacing dir : EnumFacing.VALUES) {
int redstoneSide = worldObj.getRedstonePower(pos.offset(dir), dir);
int redstoneSide = world.getRedstonePower(pos.offset(dir), dir);
if(redstoneSide > 0) {
enabled = false;
break;
@@ -109,7 +109,7 @@ public class TileAvatar extends TileSimpleInventory implements IAvatarTile {
@Override
public EnumFacing getAvatarFacing() {
return worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.CARDINALS);
return world.getBlockState(getPos()).getValue(BotaniaStateProps.CARDINALS);
}
@Override
@@ -23,9 +23,9 @@ public class TileBifrost extends TileMod {
@Override
public void update() {
if(!worldObj.isRemote) {
if(!world.isRemote) {
if(ticks <= 0) {
worldObj.setBlockToAir(pos);
world.setBlockToAir(pos);
} else ticks--;
} else if(Math.random() < 0.1)
Botania.proxy.sparkleFX(pos.getX() + Math.random(), pos.getY() + Math.random(), pos.getZ() + Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random(), 0.45F + 0.2F * (float) Math.random(), 6);
@@ -70,11 +70,11 @@ public class TileBrewery extends TileSimpleInventory implements IManaReceiver {
}
if(did) {
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos);
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos);
for(RecipeBrew recipe : BotaniaAPI.brewRecipes)
if(recipe.matches(itemHandler) && recipe.getOutput(itemHandler.getStackInSlot(0)) != null) {
this.recipe = recipe;
worldObj.setBlockState(pos, ModBlocks.brewery.getDefaultState().withProperty(BotaniaStateProps.POWERED, true), 1 | 2);
world.setBlockState(pos, ModBlocks.brewery.getDefaultState().withProperty(BotaniaStateProps.POWERED, true), 1 | 2);
}
}
@@ -87,7 +87,7 @@ public class TileBrewery extends TileSimpleInventory implements IManaReceiver {
for(RecipeBrew recipe : BotaniaAPI.brewRecipes)
if(recipe.matches(itemHandler)) {
this.recipe = recipe;
worldObj.setBlockState(pos, ModBlocks.brewery.getDefaultState().withProperty(BotaniaStateProps.POWERED, true), 1 | 2);
world.setBlockState(pos, ModBlocks.brewery.getDefaultState().withProperty(BotaniaStateProps.POWERED, true), 1 | 2);
}
if(recipe == null)
@@ -97,8 +97,8 @@ public class TileBrewery extends TileSimpleInventory implements IManaReceiver {
// Update every tick.
recieveMana(0);
if(!worldObj.isRemote && recipe == null) {
List<EntityItem> items = worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos.getX(), pos.getY(), pos.getZ(), pos.getX() + 1, pos.getY() + 1, pos.getZ() + 1));
if(!world.isRemote && recipe == null) {
List<EntityItem> items = world.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos.getX(), pos.getY(), pos.getZ(), pos.getX() + 1, pos.getY() + 1, pos.getZ() + 1));
for(EntityItem item : items)
if(!item.isDead && item.getEntityItem() != null) {
ItemStack stack = item.getEntityItem();
@@ -110,7 +110,7 @@ public class TileBrewery extends TileSimpleInventory implements IManaReceiver {
if(recipe != null) {
if(!recipe.matches(itemHandler)) {
recipe = null;
worldObj.setBlockState(pos, ModBlocks.brewery.getDefaultState(), 1 | 2);
world.setBlockState(pos, ModBlocks.brewery.getDefaultState(), 1 | 2);
}
if(recipe != null) {
@@ -126,13 +126,13 @@ public class TileBrewery extends TileSimpleInventory implements IManaReceiver {
}
}
if(mana >= getManaCost() && !worldObj.isRemote) {
if(mana >= getManaCost() && !world.isRemote) {
int mana = getManaCost();
recieveMana(-mana);
if(!worldObj.isRemote) {
if(!world.isRemote) {
ItemStack output = recipe.getOutput(itemHandler.getStackInSlot(0));
EntityItem outputItem = new EntityItem(worldObj, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, output);
worldObj.spawnEntityInWorld(outputItem);
EntityItem outputItem = new EntityItem(world, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, output);
world.spawnEntity(outputItem);
}
for(int i = 0; i < getSizeInventory(); i++)
@@ -149,7 +149,7 @@ public class TileBrewery extends TileSimpleInventory implements IManaReceiver {
if(newSignal != signal) {
signal = newSignal;
worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock());
world.updateComparatorOutputLevel(pos, world.getBlockState(pos).getBlock());
}
manaLastTick = mana;
@@ -164,7 +164,7 @@ public class TileBrewery extends TileSimpleInventory implements IManaReceiver {
}
public void craftingFanciness() {
worldObj.playSound(null, pos, BotaniaSoundEvents.potionCreate, SoundCategory.BLOCKS, 1F, 1.5F + (float) Math.random() * 0.25F);
world.playSound(null, pos, BotaniaSoundEvents.potionCreate, SoundCategory.BLOCKS, 1F, 1.5F + (float) Math.random() * 0.25F);
for(int i = 0; i < 25; i++) {
Color color = new Color(recipe.getBrew().getColor(itemHandler.getStackInSlot(0)));
float r = color.getRed() / 255F;
@@ -22,7 +22,7 @@ public class TileCacophonium extends TileMod {
public ItemStack stack;
public void annoyDirewolf() {
ItemCacophonium.playSound(worldObj, stack, pos.getX(), pos.getY(), pos.getZ(), SoundCategory.BLOCKS, 1F);
ItemCacophonium.playSound(world, stack, pos.getX(), pos.getY(), pos.getZ(), SoundCategory.BLOCKS, 1F);
}
@Override
@@ -43,6 +43,6 @@ public class TileCamo extends TileMod {
@Override
public void onDataPacket(NetworkManager manager, SPacketUpdateTileEntity packet) {
super.onDataPacket(manager, packet);
worldObj.markBlockRangeForRenderUpdate(pos, pos);
world.markBlockRangeForRenderUpdate(pos, pos);
}
}
@@ -37,7 +37,7 @@ public class TileCell extends TileMod {
validCoords = getPos();
ticked = true;
} else if(!matchCoords(validCoords, this) || !matchCoords(flowerCoords, flower))
worldObj.setBlockToAir(pos);
world.setBlockToAir(pos);
}
public boolean isSameFlower(TileEntity flower) {
@@ -44,52 +44,52 @@ public class TileCocoon extends TileMod {
}
private void hatch() {
if(!worldObj.isRemote) {
worldObj.playEvent(2001, pos, Block.getStateId(getBlockType().getStateFromMeta(getBlockMetadata())));
worldObj.setBlockToAir(pos);
if(!world.isRemote) {
world.playEvent(2001, pos, Block.getStateId(getBlockType().getStateFromMeta(getBlockMetadata())));
world.setBlockToAir(pos);
EntityAgeable entity = null;
float villagerChance = Math.min(1F, (float) emeraldsGiven / (float) MAX_EMERALDS);
if(Math.random() < villagerChance) {
EntityVillager villager = new EntityVillager(worldObj);
VillagerRegistry.setRandomProfession(villager, worldObj.rand);
EntityVillager villager = new EntityVillager(world);
VillagerRegistry.setRandomProfession(villager, world.rand);
entity = villager;
} else {
float specialChance = 0.05F;
if(Math.random() < specialChance) {
int entityType = worldObj.rand.nextInt(3);
int entityType = world.rand.nextInt(3);
switch(entityType) {
case 0:
entity = new EntityHorse(worldObj);
entity = new EntityHorse(world);
break;
case 1:
entity = new EntityWolf(worldObj);
entity = new EntityWolf(world);
break;
case 2:
entity = new EntityOcelot(worldObj);
entity = new EntityOcelot(world);
break;
}
} else {
int entityType = worldObj.rand.nextInt(5);
int entityType = world.rand.nextInt(5);
switch(entityType) {
case 0:
entity = new EntitySheep(worldObj);
entity = new EntitySheep(world);
break;
case 1:
if(Math.random() < 0.01)
entity = new EntityMooshroom(worldObj);
else entity = new EntityCow(worldObj);
entity = new EntityMooshroom(world);
else entity = new EntityCow(world);
break;
case 2:
entity = new EntityPig(worldObj);
entity = new EntityPig(world);
break;
case 3:
entity = new EntityChicken(worldObj);
entity = new EntityChicken(world);
break;
case 4:
entity = new EntityRabbit(worldObj);
entity = new EntityRabbit(world);
break;
}
}
@@ -98,7 +98,7 @@ public class TileCocoon extends TileMod {
if(entity != null) {
entity.setPosition(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5);
entity.setGrowingAge(-24000);
worldObj.spawnEntityInWorld(entity);
world.spawnEntity(entity);
entity.spawnExplosionParticle();
}
}
@@ -102,7 +102,7 @@ public class TileCraftCrate extends TileOpenCrate {
@Override
public void update() {
if (worldObj.isRemote)
if (world.isRemote)
return;
if(craft(true) && canEject() || isFull())
@@ -115,7 +115,7 @@ public class TileCraftCrate extends TileOpenCrate {
if(newSignal != signal) {
signal = newSignal;
worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock());
world.updateComparatorOutputLevel(pos, world.getBlockState(pos).getBlock());
}
}
@@ -140,7 +140,7 @@ public class TileCraftCrate extends TileOpenCrate {
List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
for(IRecipe recipe : recipes)
if(recipe.matches(craft, worldObj)) {
if(recipe.matches(craft, world)) {
itemHandler.setStackInSlot(9, recipe.getCraftingResult(craft));
for(int i = 0; i < 9; i++) {
@@ -212,7 +212,7 @@ public class TileCraftCrate extends TileOpenCrate {
int lastPattern = pattern;
super.onDataPacket(manager, packet);
if(pattern != lastPattern)
worldObj.markBlockRangeForRenderUpdate(pos, pos);
world.markBlockRangeForRenderUpdate(pos, pos);
}
}
@@ -117,10 +117,10 @@ public class TileEnchanter extends TileMod implements ISparkAttachable {
if(stage != State.IDLE || itemToEnchant == null || !itemToEnchant.isItemEnchantable())
return;
List<EntityItem> items = worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos.getX() - 2, pos.getY(), pos.getZ() - 2, pos.getX() + 3, pos.getY() + 1, pos.getZ() + 3));
List<EntityItem> items = world.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos.getX() - 2, pos.getY(), pos.getZ() - 2, pos.getX() + 3, pos.getY() + 1, pos.getZ() + 3));
int count = items.size();
if(count > 0 && !worldObj.isRemote) {
if(count > 0 && !world.isRemote) {
for(EntityItem entity : items) {
ItemStack item = entity.getEntityItem();
if(item.getItem() == Items.ENCHANTED_BOOK) {
@@ -140,11 +140,11 @@ public class TileEnchanter extends TileMod implements ISparkAttachable {
@Override
public void update() {
IBlockState state = worldObj.getBlockState(getPos());
IBlockState state = world.getBlockState(getPos());
EnumFacing.Axis axis = state.getValue(BotaniaStateProps.ENCHANTER_DIRECTION);
for(BlockPos pylon : PYLON_LOCATIONS.get(axis)) {
TileEntity tile = worldObj.getTileEntity(pos.add(pylon));
TileEntity tile = world.getTileEntity(pos.add(pylon));
if(tile != null && tile instanceof TilePylon) {
((TilePylon) tile).activated = stage == State.GATHER_MANA;
if(stage == State.GATHER_MANA)
@@ -155,24 +155,24 @@ public class TileEnchanter extends TileMod implements ISparkAttachable {
if(stage != State.IDLE)
stageTicks++;
if(worldObj.isRemote)
if(world.isRemote)
return;
if(!canEnchanterExist(worldObj, pos, axis)) {
worldObj.setBlockState(pos, Blocks.LAPIS_BLOCK.getDefaultState(), 1 | 2);
PacketHandler.sendToNearby(worldObj, pos, new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.ENCHANTER_DESTROY,
if(!canEnchanterExist(world, pos, axis)) {
world.setBlockState(pos, Blocks.LAPIS_BLOCK.getDefaultState(), 1 | 2);
PacketHandler.sendToNearby(world, pos, new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.ENCHANTER_DESTROY,
pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5));
worldObj.playSound(null, pos, BotaniaSoundEvents.enchanterFade, SoundCategory.BLOCKS, 0.5F, 10F);
world.playSound(null, pos, BotaniaSoundEvents.enchanterFade, SoundCategory.BLOCKS, 0.5F, 10F);
}
switch(stage) {
case GATHER_ENCHANTS : { // Get books
if(stageTicks % 20 == 0) {
List<EntityItem> items = worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos.getX() - 2, pos.getY(), pos.getZ() - 2, pos.getX() + 3, pos.getY() + 1, pos.getZ() + 3));
List<EntityItem> items = world.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos.getX() - 2, pos.getY(), pos.getZ() - 2, pos.getX() + 3, pos.getY() + 1, pos.getZ() + 3));
int count = items.size();
boolean addedEnch = false;
if(count > 0 && !worldObj.isRemote) {
if(count > 0 && !world.isRemote) {
for(EntityItem entity : items) {
ItemStack item = entity.getEntityItem();
if(item.getItem() == Items.ENCHANTED_BOOK) {
@@ -184,7 +184,7 @@ public class TileEnchanter extends TileMod implements ISparkAttachable {
Enchantment ench = Enchantment.getEnchantmentByID(enchantId);
if(!hasEnchantAlready(ench) && isEnchantmentValid(ench)) {
this.enchants.add(new EnchantmentData(ench, enchantLvl));
worldObj.playSound(null, pos, BotaniaSoundEvents.ding, SoundCategory.BLOCKS, 1F, 1F);
world.playSound(null, pos, BotaniaSoundEvents.ding, SoundCategory.BLOCKS, 1F, 1F);
addedEnch = true;
break;
}
@@ -215,13 +215,13 @@ public class TileEnchanter extends TileMod implements ISparkAttachable {
} else if(mana >= manaRequired) {
manaRequired = 0;
for(BlockPos pylon : PYLON_LOCATIONS.get(axis))
((TilePylon) worldObj.getTileEntity(pos.add(pylon))).activated = false;
((TilePylon) world.getTileEntity(pos.add(pylon))).activated = false;
advanceStage();
} else {
ISparkEntity spark = getAttachedSpark();
if(spark != null) {
List<ISparkEntity> sparkEntities = SparkHelper.getSparksAround(worldObj, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5);
List<ISparkEntity> sparkEntities = SparkHelper.getSparksAround(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5);
for(ISparkEntity otherSpark : sparkEntities) {
if(spark == otherSpark)
continue;
@@ -283,8 +283,8 @@ public class TileEnchanter extends TileMod implements ISparkAttachable {
}
private void craftingFanciness() {
worldObj.playSound(null, pos, BotaniaSoundEvents.enchanterEnchant, SoundCategory.BLOCKS, 1F, 1F);
PacketHandler.sendToNearby(worldObj, pos,
world.playSound(null, pos, BotaniaSoundEvents.enchanterEnchant, SoundCategory.BLOCKS, 1F, 1F);
PacketHandler.sendToNearby(world, pos,
new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.ENCHANTER_CRAFT, pos.getX() + 0.5, pos.getY() + 1, pos.getZ() + 0.5));
}
@@ -315,7 +315,7 @@ public class TileEnchanter extends TileMod implements ISparkAttachable {
}
public void sync() {
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos);
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos);
}
@Override
@@ -408,7 +408,7 @@ public class TileEnchanter extends TileMod implements ISparkAttachable {
@Override
public ISparkEntity getAttachedSpark() {
List<Entity> sparks = worldObj.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(pos.getX(), pos.getY() + 1, pos.getZ(), pos.getX() + 1, pos.getY() + 2, pos.getZ() + 1), Predicates.instanceOf(ISparkEntity.class));
List<Entity> sparks = world.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(pos.getX(), pos.getY() + 1, pos.getZ(), pos.getX() + 1, pos.getY() + 2, pos.getZ() + 1), Predicates.instanceOf(ISparkEntity.class));
if(sparks.size() == 1) {
Entity e = sparks.get(0);
return (ISparkEntity) e;
@@ -28,12 +28,12 @@ public class TileEnderEye extends TileMod {
@Override
public void update() {
if (worldObj.isRemote)
if (world.isRemote)
return;
boolean wasLooking = worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.POWERED);
boolean wasLooking = world.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)));
List<EntityPlayer> players = world.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(pos.add(-range, -range, -range), pos.add(range, range, range)));
boolean looking = false;
for(EntityPlayer player : players) {
@@ -41,22 +41,22 @@ public class TileEnderEye extends TileMod {
if(helm != null && helm.getItem() == Item.getItemFromBlock(Blocks.PUMPKIN))
continue;
RayTraceResult pos = ToolCommons.raytraceFromEntity(worldObj, player, true, 64);
RayTraceResult pos = ToolCommons.raytraceFromEntity(world, player, true, 64);
if(pos != null && pos.getBlockPos() != null && pos.getBlockPos().equals(getPos())) {
looking = true;
break;
}
}
if(looking != wasLooking && !worldObj.isRemote)
worldObj.setBlockState(getPos(), worldObj.getBlockState(getPos()).withProperty(BotaniaStateProps.POWERED, looking), 1 | 2);
if(looking != wasLooking && !world.isRemote)
world.setBlockState(getPos(), world.getBlockState(getPos()).withProperty(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) worldObj).spawnParticle(EnumParticleTypes.REDSTONE, false, x, y, z, 0, 1.0D, 0.0D, 0.0D, 1.0D);
((WorldServer) world).spawnParticle(EnumParticleTypes.REDSTONE, false, x, y, z, 0, 1.0D, 0.0D, 0.0D, 1.0D);
}
}
@@ -30,7 +30,7 @@ public class TileFakeAir extends TileMod {
}
public boolean canStay() {
return SubTileBubbell.isValidBubbell(worldObj, flowerPos);
return SubTileBubbell.isValidBubbell(world, flowerPos);
}
@Nonnull
@@ -30,8 +30,8 @@ public class TileFloatingFlower extends TileMod implements IFloatingFlower {
forcedStack = null;
return retStack;
}
EnumDyeColor color = worldObj.getBlockState(getPos()).getBlock() != ModBlocks.floatingFlower ? EnumDyeColor.WHITE
: worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.COLOR);
EnumDyeColor color = world.getBlockState(getPos()).getBlock() != ModBlocks.floatingFlower ? EnumDyeColor.WHITE
: world.getBlockState(getPos()).getValue(BotaniaStateProps.COLOR);
return new ItemStack(ModBlocks.shinyFlower, 1, color.getMetadata());
}
@@ -19,13 +19,13 @@ public class TileForestEye extends TileMod {
@Override
public void update() {
if (worldObj.isRemote)
if (world.isRemote)
return;
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();
int entityCount = world.getEntitiesWithinAABB(EntityAnimal.class, new AxisAlignedBB(pos.add(-range, -range, -range), pos.add(range + 1, range + 1, range + 1))).size();
if(entityCount != entities) {
entities = entityCount;
worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock());
world.updateComparatorOutputLevel(pos, world.getBlockState(pos).getBlock());
}
}
@@ -62,17 +62,17 @@ public class TileHourglass extends TileSimpleInventory {
time = 0;
flip = !flip;
flipTicks = 4;
if(!worldObj.isRemote) {
worldObj.setBlockState(getPos(), worldObj.getBlockState(getPos()).withProperty(BotaniaStateProps.POWERED, true), 1 | 2);
if(!world.isRemote) {
world.setBlockState(getPos(), world.getBlockState(getPos()).withProperty(BotaniaStateProps.POWERED, true), 1 | 2);
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(this);
worldObj.scheduleUpdate(pos, getBlockType(), getBlockType().tickRate(worldObj));
world.scheduleUpdate(pos, getBlockType(), getBlockType().tickRate(world));
}
for(EnumFacing facing : EnumFacing.VALUES) {
BlockPos pos = getPos().offset(facing);
IBlockState state = worldObj.getBlockState(pos);
IBlockState state = world.getBlockState(pos);
if(state.getBlock() instanceof IHourglassTrigger)
((IHourglassTrigger) state.getBlock()).onTriggeredByHourglass(worldObj, pos, this);
((IHourglassTrigger) state.getBlock()).onTriggeredByHourglass(world, pos, this);
}
}
@@ -89,7 +89,7 @@ public class TileHourglass extends TileSimpleInventory {
}
public void onManaCollide() {
if(!worldObj.isRemote) {
if(!world.isRemote) {
if(dust)
time++;
else move = !move;
@@ -47,8 +47,8 @@ public class TileIncensePlate extends TileSimpleInventory {
PotionEffect effect = brew.getPotionEffects(stack).get(0);
if(timeLeft > 0) {
timeLeft--;
if(!worldObj.isRemote) {
List<EntityPlayer> players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(pos.getX() + 0.5 - RANGE, pos.getY() + 0.5 - RANGE, pos.getZ() + 0.5 - RANGE, pos.getX() + 0.5 + RANGE, pos.getY() + 0.5 + RANGE, pos.getZ() + 0.5 + RANGE));
if(!world.isRemote) {
List<EntityPlayer> players = world.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(pos.getX() + 0.5 - RANGE, pos.getY() + 0.5 - RANGE, pos.getZ() + 0.5 - RANGE, pos.getX() + 0.5 + RANGE, pos.getY() + 0.5 + RANGE, pos.getZ() + 0.5 + RANGE));
for(EntityPlayer player : players) {
PotionEffect currentEffect = player.getActivePotionEffect(effect.getPotion());
boolean nightVision = effect.getPotion() == MobEffects.NIGHT_VISION;
@@ -58,8 +58,8 @@ public class TileIncensePlate extends TileSimpleInventory {
}
}
if(worldObj.rand.nextInt(20) == 0)
worldObj.playSound(null, pos, SoundEvents.BLOCK_FIRE_AMBIENT, SoundCategory.BLOCKS, 0.1F, 1);
if(world.rand.nextInt(20) == 0)
world.playSound(null, pos, SoundEvents.BLOCK_FIRE_AMBIENT, SoundCategory.BLOCKS, 0.1F, 1);
} else {
double x = pos.getX() + 0.5;
double y = pos.getY() + 0.5;
@@ -85,7 +85,7 @@ public class TileIncensePlate extends TileSimpleInventory {
newComparator = 2;
if(comparatorOutput != newComparator) {
comparatorOutput = newComparator;
worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock());
world.updateComparatorOutputLevel(pos, world.getBlockState(pos).getBlock());
}
}
@@ -142,7 +142,7 @@ public class TileIncensePlate extends TileSimpleInventory {
@Override
public void markDirty() {
super.markDirty();
if(!worldObj.isRemote)
if(!world.isRemote)
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(this);
}
@@ -56,11 +56,11 @@ public class TileLightRelay extends TileMod implements IWandBindable {
public void mountEntity(Entity e) {
BlockPos nextDest = getNextDestination();
if(e.isRiding() || worldObj.isRemote || nextDest == null || !isValidBinding())
if(e.isRiding() || world.isRemote || nextDest == null || !isValidBinding())
return;
EntityPlayerMover mover = new EntityPlayerMover(worldObj, pos, nextDest);
worldObj.spawnEntityInWorld(mover);
EntityPlayerMover mover = new EntityPlayerMover(world, pos, nextDest);
world.spawnEntity(mover);
e.startRiding(mover);
if(!(e instanceof EntityItem)) {
mover.playSound(BotaniaSoundEvents.lightRelay, 0.2F, (float) Math.random() * 0.3F + 0.7F);
@@ -75,7 +75,7 @@ public class TileLightRelay extends TileMod implements IWandBindable {
BlockPos nextDest = getNextDestination();
if(nextDest != null && nextDest.getY() > -1 && isValidBinding()) {
if(worldObj.isRemote) {
if(world.isRemote) {
Vector3 vec = getMovementVector();
if(vec != null) {
double dist = 0.1;
@@ -102,9 +102,9 @@ public class TileLightRelay extends TileMod implements IWandBindable {
BlockPos endpoint = getEndpoint();
if(endpoint != null) {
AxisAlignedBB aabb = ModBlocks.lightRelay.getBoundingBox(worldObj.getBlockState(pos), worldObj, pos).offset(pos);
AxisAlignedBB aabb = ModBlocks.lightRelay.getBoundingBox(world.getBlockState(pos), world, pos).offset(pos);
float range = 0.5F;
List<EntityEnderPearl> enderPearls = worldObj.getEntitiesWithinAABB(EntityEnderPearl.class, aabb.expandXyz(range));
List<EntityEnderPearl> enderPearls = world.getEntitiesWithinAABB(EntityEnderPearl.class, aabb.expandXyz(range));
for(EntityEnderPearl pearl : enderPearls) {
pearl.setPositionAndUpdate(
endpoint.getX() + pearl.posX - pos.getX(),
@@ -122,7 +122,7 @@ public class TileLightRelay extends TileMod implements IWandBindable {
if(nextDest == null)
return false;
Block block = worldObj.getBlockState(nextDest).getBlock();
Block block = world.getBlockState(nextDest).getBlock();
return block == ModBlocks.lightRelay;
}
@@ -142,7 +142,7 @@ public class TileLightRelay extends TileMod implements IWandBindable {
if(coords == null)
return lastCoords;
TileEntity tile = worldObj.getTileEntity(coords);
TileEntity tile = world.getTileEntity(coords);
if(tile != null && tile instanceof TileLightRelay)
relay = (TileLightRelay) tile;
else return lastCoords;
@@ -167,7 +167,7 @@ public class TileLightRelay extends TileMod implements IWandBindable {
}
public BlockPos getNextDestination() {
IBlockState state = worldObj.getBlockState(pos);
IBlockState state = world.getBlockState(pos);
if(state.getValue(BotaniaStateProps.LUMINIZER_VARIANT) == LuminizerVariant.TOGGLE && state.getValue(BotaniaStateProps.POWERED))
return null;
else if(state.getValue(BotaniaStateProps.LUMINIZER_VARIANT) == LuminizerVariant.FORK) {
@@ -175,7 +175,7 @@ public class TileLightRelay extends TileMod implements IWandBindable {
for(int i = -2; i < 3; i++) {
BlockPos testPos = pos.add(0, i, 0);
IBlockState testState = worldObj.getBlockState(testPos);
IBlockState testState = world.getBlockState(testPos);
if(testState.getBlock() == ModBlocks.animatedTorch) {
torchPos = testPos;
break;
@@ -183,11 +183,11 @@ public class TileLightRelay extends TileMod implements IWandBindable {
}
if(torchPos != null) {
TileAnimatedTorch torch = (TileAnimatedTorch) worldObj.getTileEntity(torchPos);
TileAnimatedTorch torch = (TileAnimatedTorch) world.getTileEntity(torchPos);
EnumFacing side = TileAnimatedTorch.SIDES[torch.side].getOpposite();
for(int i = 1; i < MAX_DIST; i++) {
BlockPos testPos = pos.offset(side, i);
IBlockState testState = worldObj.getBlockState(testPos);
IBlockState testState = world.getBlockState(testPos);
if(testState.getBlock() == ModBlocks.lightRelay)
return testPos;
}
@@ -204,7 +204,7 @@ public class TileLightRelay extends TileMod implements IWandBindable {
@Override
public boolean bindTo(EntityPlayer player, ItemStack wand, BlockPos pos, EnumFacing side) {
if(player.worldObj.getBlockState(pos).getBlock() != ModBlocks.lightRelay || pos.distanceSq(getPos()) > MAX_DIST * MAX_DIST)
if(player.world.getBlockState(pos).getBlock() != ModBlocks.lightRelay || pos.distanceSq(getPos()) > MAX_DIST * MAX_DIST)
return false;
bindPos = pos;
@@ -256,7 +256,7 @@ public class TileLightRelay extends TileMod implements IWandBindable {
public void onUpdate() {
super.onUpdate();
if(getPassengers().isEmpty() && !worldObj.isRemote) {
if(getPassengers().isEmpty() && !world.isRemote) {
setDead();
return;
}
@@ -269,11 +269,11 @@ public class TileLightRelay extends TileMod implements IWandBindable {
BlockPos exitPos = getExitPos();
if(pos.equals(exitPos)) {
TileEntity tile = worldObj.getTileEntity(pos);
TileEntity tile = world.getTileEntity(pos);
if(tile != null && tile instanceof TileLightRelay) {
if(worldObj.getBlockState(pos).getValue(BotaniaStateProps.LUMINIZER_VARIANT) == LuminizerVariant.DETECTOR) {
worldObj.setBlockState(pos, worldObj.getBlockState(pos).withProperty(BotaniaStateProps.POWERED, true), 1 | 2);
worldObj.scheduleUpdate(pos, tile.getBlockType(), tile.getBlockType().tickRate(worldObj));
if(world.getBlockState(pos).getValue(BotaniaStateProps.LUMINIZER_VARIANT) == LuminizerVariant.DETECTOR) {
world.setBlockState(pos, world.getBlockState(pos).withProperty(BotaniaStateProps.POWERED, true), 1 | 2);
world.scheduleUpdate(pos, tile.getBlockType(), tile.getBlockType().tickRate(world));
}
TileLightRelay relay = (TileLightRelay) tile;
@@ -32,7 +32,7 @@ public class TileManaFlame extends TileMod {
public void update() {
float c = 0.3F;
if(worldObj.isRemote && Math.random() < c) {
if(world.isRemote && Math.random() < c) {
float v = 0.1F;
float r = (float) (color >> 16 & 0xFF) / 0xFF;
@@ -42,12 +42,12 @@ public class TileOpenCrate extends TileSimpleInventory {
@Override
public void update() {
if (worldObj.isRemote)
if (world.isRemote)
return;
boolean redstone = false;
for(EnumFacing dir : EnumFacing.VALUES) {
int redstoneSide = worldObj.getRedstonePower(pos.offset(dir), dir);
int redstoneSide = world.getRedstonePower(pos.offset(dir), dir);
if(redstoneSide > 0) {
redstone = true;
break;
@@ -62,13 +62,13 @@ public class TileOpenCrate extends TileSimpleInventory {
}
public boolean canEject() {
IBlockState stateBelow = worldObj.getBlockState(pos.down());
IBlockState stateBelow = world.getBlockState(pos.down());
Block blockBelow = stateBelow.getBlock();
return blockBelow.isAir(stateBelow, worldObj, pos.down()) || stateBelow.getCollisionBoundingBox(worldObj, pos.down()) == null;
return blockBelow.isAir(stateBelow, world, pos.down()) || stateBelow.getCollisionBoundingBox(world, pos.down()) == null;
}
public void eject(ItemStack stack, boolean redstone) {
EntityItem item = new EntityItem(worldObj, pos.getX() + 0.5, pos.getY() - 0.5, pos.getZ() + 0.5, stack);
EntityItem item = new EntityItem(world, pos.getX() + 0.5, pos.getY() - 0.5, pos.getZ() + 0.5, stack);
item.motionX = 0;
item.motionY = 0;
item.motionZ = 0;
@@ -81,7 +81,7 @@ public class TileOpenCrate extends TileSimpleInventory {
itemHandler.setStackInSlot(0, null);
worldObj.spawnEntityInWorld(item);
world.spawnEntity(item);
}
public boolean onWanded(World world, EntityPlayer player, ItemStack stack) {
@@ -36,7 +36,7 @@ public class TilePlatform extends TileCamo {
void swapSurroudings(TilePlatform tile, boolean empty) {
for(EnumFacing dir : EnumFacing.VALUES) {
BlockPos pos = tile.getPos().offset(dir);
TileEntity tileAt = worldObj.getTileEntity(pos);
TileEntity tileAt = world.getTileEntity(pos);
if(tileAt != null && tileAt instanceof TilePlatform) {
TilePlatform platform = (TilePlatform) tileAt;
if(empty ? platform.camoState != null : platform.camoState == null)
@@ -47,7 +47,7 @@ public class TilePlatform extends TileCamo {
void swap(TilePlatform tile, boolean empty) {
tile.camoState = empty ? null : camoState;
worldObj.notifyBlockUpdate(tile.getPos(), worldObj.getBlockState(tile.getPos()), worldObj.getBlockState(tile.getPos()), 8);
world.notifyBlockUpdate(tile.getPos(), world.getBlockState(tile.getPos()), world.getBlockState(tile.getPos()), 8);
}
}
@@ -34,14 +34,14 @@ public class TilePylon extends TileEntity implements ITickable {
public void update() {
++ticks;
if(worldObj.getBlockState(getPos()).getBlock() != ModBlocks.pylon)
if(world.getBlockState(getPos()).getBlock() != ModBlocks.pylon)
return;
PylonVariant variant = worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.PYLON_VARIANT);
PylonVariant variant = world.getBlockState(getPos()).getValue(BotaniaStateProps.PYLON_VARIANT);
if(activated && worldObj.isRemote) {
if(worldObj.getBlockState(centerPos).getBlock() != getBlockForMeta()
|| variant == PylonVariant.NATURA && (portalOff() || worldObj.getBlockState(getPos().down()).getBlock() != ModBlocks.pool)) {
if(activated && world.isRemote) {
if(world.getBlockState(centerPos).getBlock() != getBlockForMeta()
|| variant == PylonVariant.NATURA && (portalOff() || world.getBlockState(getPos().down()).getBlock() != ModBlocks.pool)) {
activated = false;
return;
}
@@ -63,21 +63,21 @@ public class TilePylon extends TileEntity implements ITickable {
Vector3 movementVector = centerBlock.subtract(ourCoords).normalize().multiply(0.2);
Botania.proxy.wispFX(x, pos.getY() + 0.25, z, (float) Math.random() * 0.25F, 0.75F + (float) Math.random() * 0.25F, (float) Math.random() * 0.25F, 0.25F + (float) Math.random() * 0.1F, -0.075F - (float) Math.random() * 0.015F);
if(worldObj.rand.nextInt(3) == 0)
if(world.rand.nextInt(3) == 0)
Botania.proxy.wispFX(x, pos.getY() + 0.25, z, (float) Math.random() * 0.25F, 0.75F + (float) Math.random() * 0.25F, (float) Math.random() * 0.25F, 0.25F + (float) Math.random() * 0.1F, (float) movementVector.x, (float) movementVector.y, (float) movementVector.z);
}
} else {
Vector3 ourCoords = Vector3.fromTileEntityCenter(this).add(0, 1 + (Math.random() - 0.5 * 0.25), 0);
Vector3 movementVector = centerBlock.subtract(ourCoords).normalize().multiply(0.2);
Block block = worldObj.getBlockState(pos.down()).getBlock();
Block block = world.getBlockState(pos.down()).getBlock();
if(block == ModBlocks.flower || block == ModBlocks.shinyFlower) {
int hex = worldObj.getBlockState(pos.down()).getValue(BotaniaStateProps.COLOR).getMapColor().colorValue;
int hex = world.getBlockState(pos.down()).getValue(BotaniaStateProps.COLOR).getMapColor().colorValue;
int r = (hex & 0xFF0000) >> 16;
int g = (hex & 0xFF00) >> 8;
int b = hex & 0xFF;
if(worldObj.rand.nextInt(4) == 0)
if(world.rand.nextInt(4) == 0)
Botania.proxy.sparkleFX(centerBlock.x + (Math.random() - 0.5) * 0.5, centerBlock.y, centerBlock.z + (Math.random() - 0.5) * 0.5, r / 255F, g / 255F, b / 255F, (float) Math.random(), 8);
Botania.proxy.wispFX(pos.getX() + 0.5 + (Math.random() - 0.5) * 0.25, pos.getY() - 0.5, pos.getZ() + 0.5 + (Math.random() - 0.5) * 0.25, r / 255F, g / 255F, b / 255F, (float) Math.random() / 3F, -0.04F);
@@ -87,17 +87,17 @@ public class TilePylon extends TileEntity implements ITickable {
}
}
if(worldObj.rand.nextBoolean() && worldObj.isRemote)
if(world.rand.nextBoolean() && world.isRemote)
Botania.proxy.sparkleFX(pos.getX() + Math.random(), pos.getY() + Math.random() * 1.5, pos.getZ() + Math.random(), variant == PylonVariant.GAIA ? 1F : 0.5F, variant == PylonVariant.NATURA ? 1F : 0.5F, variant == PylonVariant.NATURA ? 0.5F : 1F, (float) Math.random(), 2);
}
private Block getBlockForMeta() {
return worldObj.getBlockState(pos).getValue(BotaniaStateProps.PYLON_VARIANT) == PylonVariant.MANA ? ModBlocks.enchanter : ModBlocks.alfPortal;
return world.getBlockState(pos).getValue(BotaniaStateProps.PYLON_VARIANT) == PylonVariant.MANA ? ModBlocks.enchanter : ModBlocks.alfPortal;
}
private boolean portalOff() {
return worldObj.getBlockState(centerPos).getBlock() != ModBlocks.alfPortal
|| worldObj.getBlockState(centerPos).getValue(BotaniaStateProps.ALFPORTAL_STATE) == AlfPortalState.OFF;
return world.getBlockState(centerPos).getBlock() != ModBlocks.alfPortal
|| world.getBlockState(centerPos).getValue(BotaniaStateProps.ALFPORTAL_STATE) == AlfPortalState.OFF;
}
}
@@ -68,11 +68,11 @@ public class TileRuneAltar extends TileSimpleInventory implements IManaReceiver
player.setHeldItem(hand, null);
}
EntityItem item = new EntityItem(worldObj, getPos().getX() + 0.5, getPos().getY() + 1, getPos().getZ() + 0.5, new ItemStack(ModBlocks.livingrock));
EntityItem item = new EntityItem(world, getPos().getX() + 0.5, getPos().getY() + 1, getPos().getZ() + 0.5, new ItemStack(ModBlocks.livingrock));
item.setPickupDelay(40);
item.motionX = item.motionY = item.motionZ = 0;
if(!worldObj.isRemote)
worldObj.spawnEntityInWorld(item);
if(!world.isRemote)
world.spawnEntity(item);
return true;
}
@@ -99,7 +99,7 @@ public class TileRuneAltar extends TileSimpleInventory implements IManaReceiver
}
if(did)
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos);
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos);
return true;
}
@@ -110,8 +110,8 @@ public class TileRuneAltar extends TileSimpleInventory implements IManaReceiver
// Update every tick.
recieveMana(0);
if(!worldObj.isRemote && manaToGet == 0) {
List<EntityItem> items = worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos, pos.add(1, 1, 1)));
if(!world.isRemote && manaToGet == 0) {
List<EntityItem> items = world.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos, pos.add(1, 1, 1)));
for(EntityItem item : items)
if(!item.isDead && item.getEntityItem() != null && item.getEntityItem().getItem() != Item.getItemFromBlock(ModBlocks.livingrock)) {
ItemStack stack = item.getEntityItem();
@@ -121,8 +121,8 @@ public class TileRuneAltar extends TileSimpleInventory implements IManaReceiver
}
if(worldObj.isRemote && manaToGet > 0 && mana >= manaToGet) {
if(worldObj.rand.nextInt(20) == 0) {
if(world.isRemote && manaToGet > 0 && mana >= manaToGet) {
if(world.rand.nextInt(20) == 0) {
Vector3 vec = Vector3.fromTileEntityCenter(this);
Vector3 endVec = vec.add(0, 2.5, 0);
Botania.proxy.lightningFX(vec, endVec, 2F, 0x00948B, 0x00E4D7);
@@ -143,7 +143,7 @@ public class TileRuneAltar extends TileSimpleInventory implements IManaReceiver
if(newSignal != signal) {
signal = newSignal;
worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock());
world.updateComparatorOutputLevel(pos, world.getBlockState(pos).getBlock());
}
if(recipeKeepTicks > 0)
@@ -170,8 +170,8 @@ public class TileRuneAltar extends TileSimpleInventory implements IManaReceiver
}
if(manaToGet != this.manaToGet) {
worldObj.playSound(null, pos, BotaniaSoundEvents.runeAltarStart, SoundCategory.BLOCKS, 1, 1);
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos);
world.playSound(null, pos, BotaniaSoundEvents.runeAltarStart, SoundCategory.BLOCKS, 1, 1);
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos);
}
}
@@ -189,7 +189,7 @@ public class TileRuneAltar extends TileSimpleInventory implements IManaReceiver
public void trySetLastRecipe(EntityPlayer player) {
TileAltar.tryToSetLastRecipe(player, itemHandler, lastRecipe);
if(!isEmpty())
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos);
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos);
}
public boolean hasValidRecipe() {
@@ -213,7 +213,7 @@ public class TileRuneAltar extends TileSimpleInventory implements IManaReceiver
}
if(manaToGet > 0 && mana >= manaToGet) {
List<EntityItem> items = worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos, pos.add(1, 1, 1)));
List<EntityItem> items = world.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos, pos.add(1, 1, 1)));
EntityItem livingrock = null;
for(EntityItem item : items)
if(!item.isDead && item.getEntityItem() != null && item.getEntityItem().getItem() == Item.getItemFromBlock(ModBlocks.livingrock)) {
@@ -224,22 +224,22 @@ public class TileRuneAltar extends TileSimpleInventory implements IManaReceiver
if(livingrock != null) {
int mana = recipe.getManaUsage();
recieveMana(-mana);
if(!worldObj.isRemote) {
if(!world.isRemote) {
ItemStack output = recipe.getOutput().copy();
EntityItem outputItem = new EntityItem(worldObj, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, output);
worldObj.spawnEntityInWorld(outputItem);
EntityItem outputItem = new EntityItem(world, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, output);
world.spawnEntity(outputItem);
currentRecipe = null;
cooldown = 60;
}
saveLastRecipe();
if(!worldObj.isRemote) {
if(!world.isRemote) {
for(int i = 0; i < getSizeInventory(); i++) {
ItemStack stack = itemHandler.getStackInSlot(i);
if(stack != null) {
if(stack.getItem() == ModItems.rune && (player == null || !player.capabilities.isCreativeMode)) {
EntityItem outputItem = new EntityItem(worldObj, getPos().getX() + 0.5, getPos().getY() + 1.5, getPos().getZ() + 0.5, stack.copy());
worldObj.spawnEntityInWorld(outputItem);
EntityItem outputItem = new EntityItem(world, getPos().getX() + 0.5, getPos().getY() + 1.5, getPos().getZ() + 0.5, stack.copy());
world.spawnEntity(outputItem);
}
itemHandler.setStackInSlot(i, null);
@@ -258,7 +258,7 @@ public class TileRuneAltar extends TileSimpleInventory implements IManaReceiver
}
public void craftingFanciness() {
worldObj.playSound(null, pos, BotaniaSoundEvents.runeAltarCraft, SoundCategory.BLOCKS, 1, 1);
world.playSound(null, pos, BotaniaSoundEvents.runeAltarCraft, SoundCategory.BLOCKS, 1, 1);
for(int i = 0; i < 25; i++) {
float red = (float) Math.random();
float green = (float) Math.random();
@@ -26,13 +26,13 @@ import vazkii.botania.common.item.ModItems;
public class TileSparkChanger extends TileSimpleInventory {
public void doSwap() {
if(worldObj.isRemote)
if(world.isRemote)
return;
ItemStack changeStack = itemHandler.getStackInSlot(0);
List<ISparkAttachable> attachables = new ArrayList<>();
for(EnumFacing dir : EnumFacing.HORIZONTALS) {
TileEntity tile = worldObj.getTileEntity(pos.offset(dir));
TileEntity tile = world.getTileEntity(pos.offset(dir));
if(tile != null && tile instanceof ISparkAttachable) {
ISparkAttachable attach = (ISparkAttachable) tile;
ISparkEntity spark = attach.getAttachedSpark();
@@ -46,7 +46,7 @@ public class TileSparkChanger extends TileSimpleInventory {
}
if(attachables.size() > 0) {
ISparkAttachable attach = attachables.get(worldObj.rand.nextInt(attachables.size()));
ISparkAttachable attach = attachables.get(world.rand.nextInt(attachables.size()));
ISparkEntity spark = attach.getAttachedSpark();
SparkUpgradeType upg = spark.getUpgrade();
ItemStack sparkStack = upg == SparkUpgradeType.NONE ? null : new ItemStack(ModItems.sparkUpgrade, 1, upg.ordinal() - 1);
@@ -56,7 +56,7 @@ public class TileSparkChanger extends TileSimpleInventory {
if(transfers != null)
transfers.clear();
itemHandler.setStackInSlot(0, sparkStack);
worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock());
world.updateComparatorOutputLevel(pos, world.getBlockState(pos).getBlock());
markDirty();
}
}
@@ -37,7 +37,7 @@ public class TileSpawnerClaw extends TileMod implements IManaReceiver {
@Override
public void update() {
TileEntity tileBelow = worldObj.getTileEntity(pos.down());
TileEntity tileBelow = world.getTileEntity(pos.down());
if(mana >= 5 && tileBelow instanceof TileEntityMobSpawner) {
TileEntityMobSpawner spawner = (TileEntityMobSpawner) tileBelow;
MobSpawnerBaseLogic logic = spawner.getSpawnerBaseLogic();
@@ -45,7 +45,7 @@ public class TileSpawnerClaw extends TileMod implements IManaReceiver {
try {
// Directly drawn from MobSpawnerBaseLogic, with inverted isActivated check and mana consumption
if(!((boolean) MethodHandles.isActivated.invokeExact(logic))) {
if(!worldObj.isRemote)
if(!world.isRemote)
mana -= 6;
if(logic.getSpawnerWorld().isRemote) {
@@ -76,7 +76,7 @@ public class TileSpecialFlower extends TileMod implements IWandBindable, ISubTil
@Override
public void update() {
if(subTile != null) {
TileEntity tileBelow = worldObj.getTileEntity(pos.down());
TileEntity tileBelow = world.getTileEntity(pos.down());
if(tileBelow instanceof TileRedStringRelay) {
BlockPos coords = ((TileRedStringRelay) tileBelow).getBinding();
if(coords != null) {
@@ -104,7 +104,7 @@ public class TileSpecialFlower extends TileMod implements IWandBindable, ISubTil
}
public boolean isOnSpecialSoil() {
return worldObj.getBlockState(pos.down()).getBlock() == ModBlocks.enchantedSoil;
return world.getBlockState(pos.down()).getBlock() == ModBlocks.enchantedSoil;
}
@Override
@@ -214,12 +214,12 @@ public class TileSpecialFlower extends TileMod implements IWandBindable, ISubTil
@Override
public int getSlowdownFactor() {
Block below = worldObj.getBlockState(getPos().down()).getBlock();
Block below = world.getBlockState(getPos().down()).getBlock();
if(below == Blocks.MYCELIUM)
return SLOWDOWN_FACTOR_MYCEL;
if(below == Blocks.DIRT) {
BlockDirt.DirtType type = worldObj.getBlockState(getPos().down()).getValue(BlockDirt.VARIANT);
BlockDirt.DirtType type = world.getBlockState(getPos().down()).getValue(BlockDirt.VARIANT);
if(type == BlockDirt.DirtType.PODZOL)
return SLOWDOWN_FACTOR_PODZOL;
}
@@ -18,7 +18,7 @@ public class TileSpiritShrine extends TileMod {
@Override
public void update() {
if(worldObj.isRemote) {
if(world.isRemote) {
if(ticks >= 40) {
float[][] colors = new float[][] {
{ 0F, 0.25F, 1F },
@@ -17,11 +17,11 @@ public class TileStarfield extends TileMod {
@Override
public void update() {
boolean state = worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.POWERED);
if(!worldObj.isRemote) {
boolean newState = !worldObj.isDaytime();
boolean state = world.getBlockState(getPos()).getValue(BotaniaStateProps.POWERED);
if(!world.isRemote) {
boolean newState = !world.isDaytime();
if(newState != state) {
worldObj.setBlockState(getPos(), worldObj.getBlockState(getPos()).withProperty(BotaniaStateProps.POWERED, newState), 1 | 2);
world.setBlockState(getPos(), world.getBlockState(getPos()).withProperty(BotaniaStateProps.POWERED, newState), 1 | 2);
state = newState;
}
}
@@ -79,7 +79,7 @@ public class TileTerraPlate extends TileMod implements ISparkAttachable {
removeMana = false;
ISparkEntity spark = getAttachedSpark();
if(spark != null) {
List<ISparkEntity> sparkEntities = SparkHelper.getSparksAround(worldObj, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5);
List<ISparkEntity> sparkEntities = SparkHelper.getSparksAround(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5);
for(ISparkEntity otherSpark : sparkEntities) {
if(spark == otherSpark)
continue;
@@ -91,16 +91,16 @@ public class TileTerraPlate extends TileMod implements ISparkAttachable {
if(mana > 0)
doParticles();
if(mana >= MAX_MANA && !worldObj.isRemote) {
if(mana >= MAX_MANA && !world.isRemote) {
EntityItem item = items.get(0);
for(EntityItem otherItem : items)
if(otherItem != item)
otherItem.setDead();
else item.setEntityItemStack(new ItemStack(ModItems.manaResource, 1, 4));
worldObj.playSound(null, item.posX, item.posY, item.posZ, BotaniaSoundEvents.terrasteelCraft, SoundCategory.BLOCKS, 1, 1);
world.playSound(null, item.posX, item.posY, item.posZ, BotaniaSoundEvents.terrasteelCraft, SoundCategory.BLOCKS, 1, 1);
mana = 0;
worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock());
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos);
world.updateComparatorOutputLevel(pos, world.getBlockState(pos).getBlock());
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos);
}
}
}
@@ -110,7 +110,7 @@ public class TileTerraPlate extends TileMod implements ISparkAttachable {
}
void doParticles() {
if(worldObj.isRemote) {
if(world.isRemote) {
int ticks = (int) (100.0 * ((double) getCurrentMana() / (double) MAX_MANA));
int totalSpiritCount = 3;
@@ -142,7 +142,7 @@ public class TileTerraPlate extends TileMod implements ISparkAttachable {
}
List<EntityItem> getItems() {
return worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos, pos.add(1, 1, 1)));
return world.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos, pos.add(1, 1, 1)));
}
boolean areItemsValid(List<EntityItem> items) {
@@ -184,7 +184,7 @@ public class TileTerraPlate extends TileMod implements ISparkAttachable {
}
boolean checkPlatform(int xOff, int zOff, Block block) {
return worldObj.getBlockState(pos.add(xOff, -1, zOff)).getBlock() == block;
return world.getBlockState(pos.add(xOff, -1, zOff)).getBlock() == block;
}
@Override
@@ -210,7 +210,7 @@ public class TileTerraPlate extends TileMod implements ISparkAttachable {
@Override
public void recieveMana(int mana) {
this.mana = Math.max(0, Math.min(MAX_MANA, this.mana + mana));
worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock());
world.updateComparatorOutputLevel(pos, world.getBlockState(pos).getBlock());
}
@Override
@@ -228,7 +228,7 @@ public class TileTerraPlate extends TileMod implements ISparkAttachable {
@Override
public ISparkEntity getAttachedSpark() {
List<Entity> sparks = worldObj.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(pos.up(), pos.up().add(1, 1, 1)), Predicates.instanceOf(ISparkEntity.class));
List<Entity> sparks = world.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(pos.up(), pos.up().add(1, 1, 1)), Predicates.instanceOf(ISparkEntity.class));
if(sparks.size() == 1) {
Entity e = sparks.get(0);
return (ISparkEntity) e;
@@ -18,17 +18,17 @@ public class TileTeruTeruBozu extends TileMod {
@Override
public void update() {
if (worldObj.isRemote)
if (world.isRemote)
return;
boolean isRaining = worldObj.isRaining();
if(isRaining && worldObj.rand.nextInt(9600) == 0) {
worldObj.getWorldInfo().setRaining(false);
resetRainTime(worldObj);
boolean isRaining = world.isRaining();
if(isRaining && world.rand.nextInt(9600) == 0) {
world.getWorldInfo().setRaining(false);
resetRainTime(world);
}
if(wasRaining != isRaining)
worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock());
world.updateComparatorOutputLevel(pos, world.getBlockState(pos).getBlock());
wasRaining = isRaining;
}
@@ -16,7 +16,7 @@ public class TileTinyPlanet extends TileMod {
@Override
public void update() {
ItemTinyPlanet.applyEffect(worldObj, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5);
ItemTinyPlanet.applyEffect(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5);
}
}
@@ -54,16 +54,16 @@ public class TileTinyPotato extends TileSimpleInventory {
jump();
if(!worldObj.isRemote) {
if(!world.isRemote) {
if(name.toLowerCase().trim().endsWith("shia labeouf") && nextDoIt == 0) {
nextDoIt = 40;
worldObj.playSound(null, pos, BotaniaSoundEvents.doit, SoundCategory.BLOCKS, 1F, 1F);
world.playSound(null, pos, BotaniaSoundEvents.doit, SoundCategory.BLOCKS, 1F, 1F);
}
for(int i = 0; i < getSizeInventory(); i++) {
ItemStack stackAt = getItemHandler().getStackInSlot(i);
if(stackAt != null && stackAt.getItem() == Item.getItemFromBlock(ModBlocks.tinyPotato)) {
player.addChatComponentMessage(new TextComponentString("Don't talk to me or my son ever again."));
player.sendMessage(new TextComponentString("Don't talk to me or my son ever again."));
return;
}
}
@@ -77,7 +77,7 @@ public class TileTinyPotato extends TileSimpleInventory {
@Override
public void update() {
if(worldObj.rand.nextInt(100) == 0)
if(world.rand.nextInt(100) == 0)
jump();
if(jumpTicks > 0)
@@ -17,7 +17,7 @@ import vazkii.botania.common.block.tile.TileSimpleInventory;
public abstract class TileCorporeaBase extends TileSimpleInventory {
public ICorporeaSpark getSpark() {
return CorporeaHelper.getSparkForBlock(worldObj, getPos());
return CorporeaHelper.getSparkForBlock(world, getPos());
}
}
@@ -67,7 +67,7 @@ public class TileCorporeaCrystalCube extends TileCorporeaBase implements ICorpor
copy.stackSize = 1;
requestTarget = copy;
updateCount();
if(!worldObj.isRemote)
if(!world.isRemote)
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(this);
}
@@ -82,7 +82,7 @@ public class TileCorporeaCrystalCube extends TileCorporeaBase implements ICorpor
}
public void doRequest(boolean fullStack) {
if(worldObj.isRemote)
if(world.isRemote)
return;
ICorporeaSpark spark = getSpark();
@@ -93,7 +93,7 @@ public class TileCorporeaCrystalCube extends TileCorporeaBase implements ICorpor
}
private void updateCount() {
if(worldObj.isRemote)
if(world.isRemote)
return;
int oldCount = itemCount;
@@ -113,7 +113,7 @@ public class TileCorporeaCrystalCube extends TileCorporeaBase implements ICorpor
private void onUpdateCount() {
compValue = getComparatorValue();
worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock());
world.updateComparatorOutputLevel(pos, world.getBlockState(pos).getBlock());
}
@Override
@@ -160,8 +160,8 @@ public class TileCorporeaCrystalCube extends TileCorporeaBase implements ICorpor
boolean did = false;
for(ItemStack reqStack : stacks)
if(requestTarget != null) {
EntityItem item = new EntityItem(worldObj, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, reqStack);
worldObj.spawnEntityInWorld(item);
EntityItem item = new EntityItem(world, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, reqStack);
world.spawnEntity(item);
itemCount -= reqStack.stackSize;
did = true;
}
@@ -33,7 +33,7 @@ public class TileCorporeaFunnel extends TileCorporeaBase implements ICorporeaReq
if(spark != null && spark.getMaster() != null) {
List<ItemStack> filter = getFilter();
if(!filter.isEmpty()) {
ItemStack stack = filter.get(worldObj.rand.nextInt(filter.size()));
ItemStack stack = filter.get(world.rand.nextInt(filter.size()));
if(stack != null)
doCorporeaRequest(stack, stack.stackSize, spark);
@@ -49,7 +49,7 @@ public class TileCorporeaFunnel extends TileCorporeaBase implements ICorporeaReq
};
for(EnumFacing dir : EnumFacing.HORIZONTALS) {
List<EntityItemFrame> frames = worldObj.getEntitiesWithinAABB(EntityItemFrame.class, new AxisAlignedBB(pos.offset(dir), pos.offset(dir).add(1, 1, 1)));
List<EntityItemFrame> frames = world.getEntitiesWithinAABB(EntityItemFrame.class, new AxisAlignedBB(pos.offset(dir), pos.offset(dir).add(1, 1, 1)));
for(EntityItemFrame frame : frames) {
EnumFacing orientation = frame.facingDirection;
if(orientation == dir) {
@@ -89,24 +89,24 @@ public class TileCorporeaFunnel extends TileCorporeaBase implements ICorporeaReq
if(inv != null && ItemHandlerHelper.insertItemStacked(inv, reqStack, true) == null)
ItemHandlerHelper.insertItemStacked(inv, reqStack, false);
else {
EntityItem item = new EntityItem(worldObj, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, reqStack);
worldObj.spawnEntityInWorld(item);
EntityItem item = new EntityItem(world, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, reqStack);
world.spawnEntity(item);
}
}
}
private IItemHandler getInv() {
TileEntity te = worldObj.getTileEntity(pos.down());
IItemHandler ret = InventoryHelper.getInventory(worldObj, pos.down(), EnumFacing.UP);
TileEntity te = world.getTileEntity(pos.down());
IItemHandler ret = InventoryHelper.getInventory(world, pos.down(), EnumFacing.UP);
if(ret == null)
ret = InventoryHelper.getInventory(worldObj, pos.down(), null);
ret = InventoryHelper.getInventory(world, pos.down(), null);
if(ret != null && !(te instanceof TileCorporeaFunnel))
return ret;
te = worldObj.getTileEntity(pos.down(2));
ret = InventoryHelper.getInventory(worldObj, pos.down(2), EnumFacing.UP);
te = world.getTileEntity(pos.down(2));
ret = InventoryHelper.getInventory(world, pos.down(2), EnumFacing.UP);
if(ret == null)
ret = InventoryHelper.getInventory(worldObj, pos.down(2), null);
ret = InventoryHelper.getInventory(world, pos.down(2), null);
if(ret != null && !(te instanceof TileCorporeaFunnel))
return ret;
@@ -154,7 +154,7 @@ public class TileCorporeaIndex extends TileCorporeaBase implements ICorporeaRequ
double y = pos.getY() + 0.5;
double z = pos.getZ() + 0.5;
List<EntityPlayer> players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(x - RADIUS, y - RADIUS, z - RADIUS, x + RADIUS, y + RADIUS, z + RADIUS));
List<EntityPlayer> players = world.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(x - RADIUS, y - RADIUS, z - RADIUS, x + RADIUS, y + RADIUS, z + RADIUS));
hasCloseby = false;
for(EntityPlayer player : players)
if(isInRangeOfIndex(player, this)) {
@@ -201,13 +201,13 @@ public class TileCorporeaIndex extends TileCorporeaBase implements ICorporeaRequ
spark.onItemsRequested(stacks);
for(ItemStack stack : stacks)
if(stack != null) {
EntityItem item = new EntityItem(worldObj, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, stack);
worldObj.spawnEntityInWorld(item);
EntityItem item = new EntityItem(world, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, stack);
world.spawnEntity(item);
}
}
public static boolean isInRangeOfIndex(EntityPlayer player, TileCorporeaIndex index) {
return player.worldObj.provider.getDimension() == index.worldObj.provider.getDimension() && MathHelper.pointDistancePlane(index.getPos().getX() + 0.5, index.getPos().getZ() + 0.5, player.posX, player.posZ) < RADIUS && Math.abs(index.getPos().getY() + 0.5 - player.posY + (player.worldObj.isRemote ? 0 : 1.6)) < 5;
return player.world.provider.getDimension() == index.world.provider.getDimension() && MathHelper.pointDistancePlane(index.getPos().getX() + 0.5, index.getPos().getZ() + 0.5, player.posX, player.posZ) < RADIUS && Math.abs(index.getPos().getY() + 0.5 - player.posY + (player.world.isRemote ? 0 : 1.6)) < 5;
}
public static void addPattern(String pattern, IRegexStacker stacker) {
@@ -241,7 +241,7 @@ public class TileCorporeaIndex extends TileCorporeaBase implements ICorporeaRequ
if(!nearbyIndexes.isEmpty()) {
String msg = event.getMessage().toLowerCase().trim();
for(TileCorporeaIndex index : nearbyIndexes) {
if(index.worldObj.isRemote)
if(index.world.isRemote)
continue;
ICorporeaSpark spark = index.getSpark();
@@ -266,7 +266,7 @@ public class TileCorporeaIndex extends TileCorporeaBase implements ICorporeaRequ
index.doCorporeaRequest(name, count, spark);
event.getPlayer().addChatMessage(new TextComponentTranslation("botaniamisc.requestMsg", count, WordUtils.capitalizeFully(name), CorporeaHelper.lastRequestMatches, CorporeaHelper.lastRequestExtractions).setStyle(new Style().setColor(TextFormatting.LIGHT_PURPLE)));
event.getPlayer().sendMessage(new TextComponentTranslation("botaniamisc.requestMsg", count, WordUtils.capitalizeFully(name), CorporeaHelper.lastRequestMatches, CorporeaHelper.lastRequestExtractions).setStyle(new Style().setColor(TextFormatting.LIGHT_PURPLE)));
if(CorporeaHelper.lastRequestExtractions >= 50000)
event.getPlayer().addStat(ModAchievements.superCorporeaRequest, 1);
}
@@ -279,7 +279,7 @@ public class TileCorporeaIndex extends TileCorporeaBase implements ICorporeaRequ
public static List<TileCorporeaIndex> getNearbyIndexes(EntityPlayer player) {
List<TileCorporeaIndex> indexList = new ArrayList<>();
for(TileCorporeaIndex index : indexes)
if(isInRangeOfIndex(player, index) && index.worldObj.isRemote == player.worldObj.isRemote)
if(isInRangeOfIndex(player, index) && index.world.isRemote == player.world.isRemote)
indexList.add(index);
return indexList;
}
@@ -287,7 +287,7 @@ public class TileCorporeaIndex extends TileCorporeaBase implements ICorporeaRequ
@Override
@SideOnly(Side.CLIENT)
public boolean shouldAutoComplete() {
return !getNearbyIndexes(Minecraft.getMinecraft().thePlayer).isEmpty();
return !getNearbyIndexes(Minecraft.getMinecraft().player).isEmpty();
}
}
@@ -48,13 +48,13 @@ public class TileCorporeaInterceptor extends TileCorporeaBase implements ICorpor
for(ItemStack stack_ : stacks)
missing -= stack_.stackSize;
if(missing > 0 && !worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.POWERED)) {
worldObj.setBlockState(getPos(), worldObj.getBlockState(getPos()).withProperty(BotaniaStateProps.POWERED, true), 1 | 2);
worldObj.scheduleUpdate(getPos(), getBlockType(), 2);
if(missing > 0 && !world.getBlockState(getPos()).getValue(BotaniaStateProps.POWERED)) {
world.setBlockState(getPos(), world.getBlockState(getPos()).withProperty(BotaniaStateProps.POWERED, true), 1 | 2);
world.scheduleUpdate(getPos(), getBlockType(), 2);
TileEntity requestor = source.getSparkInventory().world.getTileEntity(source.getSparkInventory().pos);
for(EnumFacing dir : EnumFacing.HORIZONTALS) {
TileEntity tile = worldObj.getTileEntity(pos.offset(dir));
TileEntity tile = world.getTileEntity(pos.offset(dir));
if(tile != null && tile instanceof TileCorporeaRetainer)
((TileCorporeaRetainer) tile).setPendingRequest(requestor.getPos(), request, count);
}
@@ -82,7 +82,7 @@ public class TileCorporeaInterceptor extends TileCorporeaBase implements ICorpor
List<ItemStack> filter = new ArrayList<>();
for(EnumFacing dir : EnumFacing.HORIZONTALS) {
List<EntityItemFrame> frames = worldObj.getEntitiesWithinAABB(EntityItemFrame.class, new AxisAlignedBB(pos.offset(dir), pos.offset(dir).add(1, 1, 1)));
List<EntityItemFrame> frames = world.getEntitiesWithinAABB(EntityItemFrame.class, new AxisAlignedBB(pos.offset(dir), pos.offset(dir).add(1, 1, 1)));
for(EntityItemFrame frame : frames) {
EnumFacing orientation = frame.facingDirection;
if(orientation == dir)
@@ -47,7 +47,7 @@ public class TileCorporeaRetainer extends TileMod {
this.request = request;
this.requestCount = requestCount;
pendingRequest = true;
worldObj.updateComparatorOutputLevel(getPos(), worldObj.getBlockState(getPos()).getBlock());
world.updateComparatorOutputLevel(getPos(), world.getBlockState(getPos()).getBlock());
}
public boolean hasPendingRequest() {
@@ -58,14 +58,14 @@ public class TileCorporeaRetainer extends TileMod {
if(!hasPendingRequest())
return;
ICorporeaSpark spark = CorporeaHelper.getSparkForBlock(worldObj, requestPos);
ICorporeaSpark spark = CorporeaHelper.getSparkForBlock(world, requestPos);
if(spark != null) {
InvWithLocation inv = spark.getSparkInventory();
if(inv != null && inv.world.getTileEntity(inv.pos) instanceof ICorporeaRequestor) {
ICorporeaRequestor requestor = (ICorporeaRequestor) inv.world.getTileEntity(inv.pos);
requestor.doCorporeaRequest(request, requestCount, spark);
pendingRequest = false;
worldObj.updateComparatorOutputLevel(getPos(), worldObj.getBlockState(getPos()).getBlock());
world.updateComparatorOutputLevel(getPos(), world.getBlockState(getPos()).getBlock());
}
}
}
@@ -58,7 +58,7 @@ public class TileBellows extends TileMod {
if(movePos < max && active && moving >= 0F) {
if(moving == 0F)
worldObj.playSound(null, pos, BotaniaSoundEvents.bellows, SoundCategory.BLOCKS, 0.1F, 3F);
world.playSound(null, pos, BotaniaSoundEvents.bellows, SoundCategory.BLOCKS, 0.1F, 3F);
if(tile instanceof TileEntityFurnace) {
TileEntityFurnace furnace = (TileEntityFurnace) tile;
@@ -67,32 +67,32 @@ public class TileBellows extends TileMod {
furnace.setField(0, Math.max(0, furnace.getField(0) - 10)); // burnTime
}
if(furnace.hasWorldObj() && furnace.getBlockType() == Blocks.LIT_FURNACE) {
if(furnace.hasWorld() && furnace.getBlockType() == Blocks.LIT_FURNACE) {
// Copypasta from BlockFurnace
EnumFacing enumfacing = worldObj.getBlockState(furnace.getPos()).getValue(BlockFurnace.FACING);
EnumFacing enumfacing = world.getBlockState(furnace.getPos()).getValue(BlockFurnace.FACING);
double d0 = pos.getX() + 0.5D;
double d1 = pos.getY() + worldObj.rand.nextDouble() * 6.0D / 16.0D;
double d1 = pos.getY() + world.rand.nextDouble() * 6.0D / 16.0D;
double d2 = pos.getZ() + 0.5D;
double d3 = 0.52D;
double d4 = worldObj.rand.nextDouble() * 0.6D - 0.3D;
double d4 = world.rand.nextDouble() * 0.6D - 0.3D;
switch (enumfacing)
{
case WEST:
worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 - d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D);
worldObj.spawnParticle(EnumParticleTypes.FLAME, d0 - d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D);
world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 - d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D);
world.spawnParticle(EnumParticleTypes.FLAME, d0 - d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D);
break;
case EAST:
worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D);
worldObj.spawnParticle(EnumParticleTypes.FLAME, d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D);
world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D);
world.spawnParticle(EnumParticleTypes.FLAME, d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D);
break;
case NORTH:
worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 - d3, 0.0D, 0.0D, 0.0D);
worldObj.spawnParticle(EnumParticleTypes.FLAME, d0 + d4, d1, d2 - d3, 0.0D, 0.0D, 0.0D);
world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 - d3, 0.0D, 0.0D, 0.0D);
world.spawnParticle(EnumParticleTypes.FLAME, d0 + d4, d1, d2 - d3, 0.0D, 0.0D, 0.0D);
break;
case SOUTH:
worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 + d3, 0.0D, 0.0D, 0.0D);
worldObj.spawnParticle(EnumParticleTypes.FLAME, d0 + d4, d1, d2 + d3, 0.0D, 0.0D, 0.0D);
world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 + d3, 0.0D, 0.0D, 0.0D);
world.spawnParticle(EnumParticleTypes.FLAME, d0 + d4, d1, d2 + d3, 0.0D, 0.0D, 0.0D);
default: break;
}
}
@@ -118,8 +118,8 @@ public class TileBellows extends TileMod {
}
public TileEntity getLinkedTile() {
EnumFacing side = worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.CARDINALS);
return worldObj.getTileEntity(getPos().offset(side));
EnumFacing side = world.getBlockState(getPos()).getValue(BotaniaStateProps.CARDINALS);
return world.getTileEntity(getPos().offset(side));
}
@Override
@@ -133,11 +133,11 @@ public class TileBellows extends TileMod {
}
public void setActive(boolean active) {
if(!worldObj.isRemote) {
if(!world.isRemote) {
boolean diff = this.active != active;
this.active = active;
if(diff)
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos);
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos);
}
}
Loaded 100 of 252 files, more files were not shown because too many files have changed in this diff. Show more