update forge and mappings
This commit is contained in:
@@ -50,7 +50,7 @@ public class FluidGridHandler implements IFluidGridHandler {
|
||||
|
||||
if (shift) {
|
||||
if (!player.inventory.addItemStackToInventory(bucket.copy())) {
|
||||
InventoryHelper.spawnItemStack(player.worldObj, player.getPosition().getX(), player.getPosition().getY(), player.getPosition().getZ(), bucket);
|
||||
InventoryHelper.spawnItemStack(player.getEntityWorld(), player.getPosition().getX(), player.getPosition().getY(), player.getPosition().getZ(), bucket);
|
||||
}
|
||||
} else {
|
||||
player.inventory.setItemStack(bucket);
|
||||
|
||||
@@ -36,7 +36,7 @@ public class NetworkItemWirelessCraftingMonitor implements INetworkItem {
|
||||
return false;
|
||||
}
|
||||
|
||||
player.openGui(RS.INSTANCE, RSGui.WIRELESS_CRAFTING_MONITOR, player.worldObj, hand.ordinal(), controllerWorld.provider.getDimension(), 0);
|
||||
player.openGui(RS.INSTANCE, RSGui.WIRELESS_CRAFTING_MONITOR, player.getEntityWorld(), hand.ordinal(), controllerWorld.provider.getDimension(), 0);
|
||||
|
||||
network.sendCraftingMonitorUpdate((EntityPlayerMP) player);
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ public class NetworkItemWirelessGrid implements INetworkItem {
|
||||
return false;
|
||||
}
|
||||
|
||||
player.openGui(RS.INSTANCE, RSGui.WIRELESS_GRID, player.worldObj, hand.ordinal(), controllerWorld.provider.getDimension(), 0);
|
||||
player.openGui(RS.INSTANCE, RSGui.WIRELESS_GRID, player.getEntityWorld(), hand.ordinal(), controllerWorld.provider.getDimension(), 0);
|
||||
|
||||
network.sendItemStorageToClient((EntityPlayerMP) player);
|
||||
|
||||
|
||||
@@ -254,8 +254,8 @@ public class BlockCable extends BlockCoverable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState onBlockPlaced(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase entity) {
|
||||
IBlockState state = super.onBlockPlaced(world, pos, facing, hitX, hitY, hitZ, meta, entity);
|
||||
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase entity) {
|
||||
IBlockState state = super.getStateForPlacement(world, pos, facing, hitX, hitY, hitZ, meta, entity);
|
||||
|
||||
if (getPlacementType() != null) {
|
||||
return state.withProperty(DIRECTION, getPlacementType().getFrom(facing, pos, entity));
|
||||
|
||||
@@ -53,7 +53,7 @@ public class ContainerCraftingSettings extends ContainerBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer player) {
|
||||
public boolean isUsableByPlayer(EntityPlayer player) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ public class ContainerGrid extends ContainerBase {
|
||||
public void onContainerClosed(EntityPlayer player) {
|
||||
super.onContainerClosed(player);
|
||||
|
||||
if (!player.worldObj.isRemote && grid instanceof WirelessGrid) {
|
||||
if (!player.getEntityWorld().isRemote && grid instanceof WirelessGrid) {
|
||||
((WirelessGrid) grid).onClose(player);
|
||||
}
|
||||
}
|
||||
@@ -101,7 +101,7 @@ public class ContainerGrid extends ContainerBase {
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer player, int slotIndex) {
|
||||
if (!player.worldObj.isRemote) {
|
||||
if (!player.getEntityWorld().isRemote) {
|
||||
Slot slot = inventorySlots.get(slotIndex);
|
||||
|
||||
if (slot.getHasStack()) {
|
||||
|
||||
@@ -24,7 +24,7 @@ public class SlotGridCraftingResult extends SlotCrafting {
|
||||
|
||||
onCrafting(stack);
|
||||
|
||||
if (!player.worldObj.isRemote) {
|
||||
if (!player.getEntityWorld().isRemote) {
|
||||
grid.onCrafted(player);
|
||||
|
||||
container.sendCraftingSlots();
|
||||
|
||||
@@ -109,7 +109,7 @@ public abstract class GuiBase extends GuiContainer {
|
||||
FluidStack stack = ((ItemHandlerFluid) ((SlotItemHandler) slot).getItemHandler()).getFluidStackInSlot(slot.getSlotIndex());
|
||||
|
||||
if (stack != null) {
|
||||
FLUID_RENDERER.draw(mc, guiLeft + slot.xDisplayPosition, guiTop + slot.yDisplayPosition, stack);
|
||||
FLUID_RENDERER.draw(mc, guiLeft + slot.xPos, guiTop + slot.yPos, stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ public class GuiCraftingPreview extends GuiBase {
|
||||
}
|
||||
|
||||
if (hoveringStack != null) {
|
||||
drawTooltip(mouseX, mouseY, hoveringStack.getTooltip(Minecraft.getMinecraft().thePlayer, false));
|
||||
drawTooltip(mouseX, mouseY, hoveringStack.getTooltip(Minecraft.getMinecraft().player, false));
|
||||
} else if (hoveringFluid != null) {
|
||||
drawTooltip(mouseX, mouseY, hoveringFluid.getLocalizedName());
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ public class ClientStackItem implements IClientStack {
|
||||
|
||||
@Override
|
||||
public String getTooltip() {
|
||||
List<String> lines = stack.getTooltip(Minecraft.getMinecraft().thePlayer, Minecraft.getMinecraft().gameSettings.advancedItemTooltips);
|
||||
List<String> lines = stack.getTooltip(Minecraft.getMinecraft().player, Minecraft.getMinecraft().gameSettings.advancedItemTooltips);
|
||||
|
||||
// From GuiScreen#renderToolTip
|
||||
for (int i = 0; i < lines.size(); ++i) {
|
||||
|
||||
@@ -69,10 +69,10 @@ public abstract class ItemNetworkItem extends ItemEnergyContainer implements INe
|
||||
if (((TileController) controller).getNetworkItemHandler().onOpen(player, controllerWorld, hand)) {
|
||||
return new ActionResult<>(EnumActionResult.SUCCESS, stack);
|
||||
} else {
|
||||
player.addChatComponentMessage(new TextComponentTranslation("misc.refinedstorage:network_item.out_of_range"));
|
||||
player.sendMessage(new TextComponentTranslation("misc.refinedstorage:network_item.out_of_range"));
|
||||
}
|
||||
} else {
|
||||
player.addChatComponentMessage(new TextComponentTranslation("misc.refinedstorage:network_item.not_found"));
|
||||
player.sendMessage(new TextComponentTranslation("misc.refinedstorage:network_item.not_found"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ public class ItemPattern extends ItemBase implements ICraftingPatternProvider {
|
||||
return;
|
||||
}
|
||||
|
||||
ICraftingPattern pattern = getPatternFromCache(player.worldObj, stack);
|
||||
ICraftingPattern pattern = getPatternFromCache(player.getEntityWorld(), stack);
|
||||
|
||||
if (pattern.isValid()) {
|
||||
if (GuiScreen.isShiftKeyDown() || isProcessing(stack)) {
|
||||
|
||||
@@ -96,7 +96,7 @@ public class ItemWrench extends ItemBase {
|
||||
|
||||
tile.markDirty();
|
||||
|
||||
player.addChatComponentMessage(new TextComponentTranslation("item.refinedstorage:wrench.read"));
|
||||
player.sendMessage(new TextComponentTranslation("item.refinedstorage:wrench.read"));
|
||||
} else {
|
||||
canWrite = true;
|
||||
}
|
||||
@@ -108,7 +108,7 @@ public class ItemWrench extends ItemBase {
|
||||
stack.getTagCompound().setString(NBT_WRENCHED_TILE, wrenchable.getClass().getName());
|
||||
stack.getTagCompound().setTag(NBT_WRENCHED_DATA, wrenchable.writeConfiguration(new NBTTagCompound()));
|
||||
|
||||
player.addChatComponentMessage(new TextComponentTranslation("item.refinedstorage:wrench.saved"));
|
||||
player.sendMessage(new TextComponentTranslation("item.refinedstorage:wrench.saved"));
|
||||
}
|
||||
|
||||
return EnumActionResult.SUCCESS;
|
||||
@@ -129,7 +129,7 @@ public class ItemWrench extends ItemBase {
|
||||
|
||||
next.writeToNBT(stack.getTagCompound());
|
||||
|
||||
player.addChatComponentMessage(new TextComponentTranslation(
|
||||
player.sendMessage(new TextComponentTranslation(
|
||||
"item.refinedstorage:wrench.mode",
|
||||
new TextComponentTranslation("item.refinedstorage:wrench.mode." + next.id).setStyle(new Style().setColor(TextFormatting.YELLOW))
|
||||
));
|
||||
|
||||
@@ -39,7 +39,7 @@ public class MessageGridCraftingClear extends MessageHandlerPlayerToServer<Messa
|
||||
|
||||
@Override
|
||||
public void handle(MessageGridCraftingClear message, EntityPlayerMP player) {
|
||||
TileEntity tile = player.worldObj.getTileEntity(new BlockPos(message.x, message.y, message.z));
|
||||
TileEntity tile = player.getEntityWorld().getTileEntity(new BlockPos(message.x, message.y, message.z));
|
||||
|
||||
if (tile instanceof TileGrid) {
|
||||
TileGrid grid = (TileGrid) tile;
|
||||
|
||||
@@ -39,7 +39,7 @@ public class MessageGridPatternCreate extends MessageHandlerPlayerToServer<Messa
|
||||
|
||||
@Override
|
||||
public void handle(MessageGridPatternCreate message, EntityPlayerMP player) {
|
||||
TileEntity tile = player.worldObj.getTileEntity(new BlockPos(message.x, message.y, message.z));
|
||||
TileEntity tile = player.getEntityWorld().getTileEntity(new BlockPos(message.x, message.y, message.z));
|
||||
|
||||
if (tile instanceof TileGrid && ((TileGrid) tile).getType() == EnumGridType.PATTERN) {
|
||||
((TileGrid) tile).onCreatePattern();
|
||||
|
||||
@@ -37,7 +37,7 @@ public class MessageProcessingPatternEncoderClear extends MessageHandlerPlayerTo
|
||||
|
||||
@Override
|
||||
public void handle(MessageProcessingPatternEncoderClear message, EntityPlayerMP player) {
|
||||
TileEntity tile = player.worldObj.getTileEntity(new BlockPos(message.x, message.y, message.z));
|
||||
TileEntity tile = player.getEntityWorld().getTileEntity(new BlockPos(message.x, message.y, message.z));
|
||||
|
||||
if (tile instanceof TileProcessingPatternEncoder) {
|
||||
TileProcessingPatternEncoder encoder = (TileProcessingPatternEncoder) tile;
|
||||
|
||||
@@ -260,9 +260,9 @@ public class ProxyClient extends ProxyCommon {
|
||||
@SubscribeEvent
|
||||
public void onPlayerLoggedIn(PlayerEvent.PlayerLoggedInEvent e) {
|
||||
if (RS.VERSION.contains("beta")) {
|
||||
e.player.addChatComponentMessage(new TextComponentString("" + TextFormatting.RED + TextFormatting.BOLD + "WARNING: You are playing on a beta version of Refined Storage (" + RS.VERSION + ")!" + TextFormatting.RESET));
|
||||
e.player.addChatComponentMessage(new TextComponentString("Literally anything can happen: world breaking bugs, item duplication bugs, etc. So, make sure you make backups."));
|
||||
e.player.addChatComponentMessage(new TextComponentString("If you encounter a bug, please report it on the GitHub issue tracker."));
|
||||
e.player.sendMessage(new TextComponentString("" + TextFormatting.RED + TextFormatting.BOLD + "WARNING: You are playing on a beta version of Refined Storage (" + RS.VERSION + ")!" + TextFormatting.RESET));
|
||||
e.player.sendMessage(new TextComponentString("Literally anything can happen: world breaking bugs, item duplication bugs, etc. So, make sure you make backups."));
|
||||
e.player.sendMessage(new TextComponentString("If you encounter a bug, please report it on the GitHub issue tracker."));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -291,15 +291,15 @@ public class ProxyClient extends ProxyCommon {
|
||||
|
||||
BlockPos pos = e.getTarget().getBlockPos();
|
||||
|
||||
IBlockState state = player.worldObj.getBlockState(pos);
|
||||
IBlockState state = player.getEntityWorld().getBlockState(pos);
|
||||
|
||||
if (!(state.getBlock() instanceof BlockCable)) {
|
||||
return;
|
||||
}
|
||||
|
||||
state = ((BlockCable) state.getBlock()).getActualState(state, player.worldObj, pos);
|
||||
state = ((BlockCable) state.getBlock()).getActualState(state, player.getEntityWorld(), pos);
|
||||
|
||||
if (((BlockCable) state.getBlock()).collisionRayTrace(state, player.worldObj, pos, RayTraceUtils.getStart(player), RayTraceUtils.getEnd(player)) instanceof PartMOP) {
|
||||
if (((BlockCable) state.getBlock()).collisionRayTrace(state, player.getEntityWorld(), pos, RayTraceUtils.getStart(player), RayTraceUtils.getEnd(player)) instanceof PartMOP) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ public abstract class TileBase extends TileEntity implements ITickable {
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
if (!worldObj.isRemote) {
|
||||
if (!getWorld().isRemote) {
|
||||
ticks++;
|
||||
|
||||
dataManager.detectAndSendChanges();
|
||||
@@ -32,8 +32,8 @@ public abstract class TileBase extends TileEntity implements ITickable {
|
||||
}
|
||||
|
||||
public void updateBlock() {
|
||||
if (worldObj != null) {
|
||||
worldObj.notifyBlockUpdate(pos, worldObj.getBlockState(pos), worldObj.getBlockState(pos), 1 | 2);
|
||||
if (getWorld() != null) {
|
||||
getWorld().notifyBlockUpdate(pos, getWorld().getBlockState(pos), getWorld().getBlockState(pos), 1 | 2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ public abstract class TileBase extends TileEntity implements ITickable {
|
||||
}
|
||||
|
||||
public TileEntity getFacingTile() {
|
||||
return worldObj.getTileEntity(pos.offset(direction));
|
||||
return getWorld().getTileEntity(pos.offset(direction));
|
||||
}
|
||||
|
||||
public IItemHandler getDrops() {
|
||||
@@ -123,13 +123,13 @@ public abstract class TileBase extends TileEntity implements ITickable {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
return o instanceof TileBase && ((TileBase) o).getPos().equals(pos) && ((TileBase) o).getWorld().provider.getDimension() == worldObj.provider.getDimension();
|
||||
return o instanceof TileBase && ((TileBase) o).getPos().equals(pos) && ((TileBase) o).getWorld().provider.getDimension() == getWorld().provider.getDimension();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = pos.hashCode();
|
||||
result = 31 * result + worldObj.provider.getDimension();
|
||||
result = 31 * result + getWorld().provider.getDimension();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ public class TileConstructor extends TileMultipartNode implements IComparable, I
|
||||
super.onContentsChanged(slot);
|
||||
|
||||
item = getStackInSlot(slot) == null ? null : getStackInSlot(slot).copy();
|
||||
block = SlotSpecimen.getBlockState(worldObj, pos.offset(getDirection()), getStackInSlot(slot));
|
||||
block = SlotSpecimen.getBlockState(getWorld(), pos.offset(getDirection()), getStackInSlot(slot));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -119,7 +119,7 @@ public class TileConstructor extends TileMultipartNode implements IComparable, I
|
||||
ItemStack took = network.extractItem(item, 1, false);
|
||||
|
||||
if (took != null) {
|
||||
worldObj.spawnEntityInWorld(new EntityFireworkRocket(worldObj, getDispensePositionX(), getDispensePositionY(), getDispensePositionZ(), took));
|
||||
getWorld().spawnEntity(new EntityFireworkRocket(getWorld(), getDispensePositionX(), getDispensePositionY(), getDispensePositionZ(), took));
|
||||
}
|
||||
} else {
|
||||
dropItem();
|
||||
@@ -133,7 +133,7 @@ public class TileConstructor extends TileMultipartNode implements IComparable, I
|
||||
|
||||
Block block = stack.getFluid().getBlock();
|
||||
|
||||
if (worldObj.isAirBlock(front) && block.canPlaceBlockAt(worldObj, front)) {
|
||||
if (getWorld().isAirBlock(front) && block.canPlaceBlockAt(getWorld(), front)) {
|
||||
FluidStack took = network.extractFluid(stack, Fluid.BUCKET_VOLUME, compare, false);
|
||||
|
||||
if (took != null) {
|
||||
@@ -145,7 +145,7 @@ public class TileConstructor extends TileMultipartNode implements IComparable, I
|
||||
state = Blocks.FLOWING_LAVA.getDefaultState();
|
||||
}
|
||||
|
||||
worldObj.setBlockState(front, state, 1 | 2);
|
||||
getWorld().setBlockState(front, state, 1 | 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -156,14 +156,14 @@ public class TileConstructor extends TileMultipartNode implements IComparable, I
|
||||
private void placeBlock() {
|
||||
BlockPos front = pos.offset(getDirection());
|
||||
|
||||
if (worldObj.isAirBlock(front) && block.getBlock().canPlaceBlockAt(worldObj, front)) {
|
||||
if (getWorld().isAirBlock(front) && block.getBlock().canPlaceBlockAt(getWorld(), front)) {
|
||||
ItemStack took = network.extractItem(itemFilters.getStackInSlot(0), 1, compare, true);
|
||||
|
||||
if (took != null) {
|
||||
@SuppressWarnings("deprecation")
|
||||
IBlockState state = block.getBlock().getStateFromMeta(took.getMetadata());
|
||||
|
||||
BlockEvent.PlaceEvent e = new BlockEvent.PlaceEvent(new BlockSnapshot(worldObj, front, state), worldObj.getBlockState(pos), FakePlayerFactory.getMinecraft((WorldServer) worldObj), null);
|
||||
BlockEvent.PlaceEvent e = new BlockEvent.PlaceEvent(new BlockSnapshot(getWorld(), front, state), getWorld().getBlockState(pos), FakePlayerFactory.getMinecraft((WorldServer) getWorld()), null);
|
||||
|
||||
if (MinecraftForge.EVENT_BUS.post(e)) {
|
||||
return;
|
||||
@@ -171,16 +171,16 @@ public class TileConstructor extends TileMultipartNode implements IComparable, I
|
||||
|
||||
network.extractItem(itemFilters.getStackInSlot(0), 1, compare, false);
|
||||
|
||||
worldObj.setBlockState(front, state, 1 | 2);
|
||||
getWorld().setBlockState(front, state, 1 | 2);
|
||||
|
||||
// From ItemBlock#onItemUse
|
||||
SoundType blockSound = block.getBlock().getSoundType(state, worldObj, pos, null);
|
||||
worldObj.playSound(null, front, blockSound.getPlaceSound(), SoundCategory.BLOCKS, (blockSound.getVolume() + 1.0F) / 2.0F, blockSound.getPitch() * 0.8F);
|
||||
SoundType blockSound = block.getBlock().getSoundType(state, getWorld(), pos, null);
|
||||
getWorld().playSound(null, front, blockSound.getPlaceSound(), SoundCategory.BLOCKS, (blockSound.getVolume() + 1.0F) / 2.0F, blockSound.getPitch() * 0.8F);
|
||||
|
||||
if (block.getBlock() == Blocks.SKULL) {
|
||||
worldObj.setBlockState(front, worldObj.getBlockState(front).withProperty(BlockSkull.FACING, getDirection()));
|
||||
getWorld().setBlockState(front, getWorld().getBlockState(front).withProperty(BlockSkull.FACING, getDirection()));
|
||||
|
||||
TileEntity tile = worldObj.getTileEntity(front);
|
||||
TileEntity tile = getWorld().getTileEntity(front);
|
||||
|
||||
if (tile instanceof TileEntitySkull) {
|
||||
TileEntitySkull skullTile = (TileEntitySkull) tile;
|
||||
@@ -203,7 +203,7 @@ public class TileConstructor extends TileMultipartNode implements IComparable, I
|
||||
skullTile.setType(item.getMetadata());
|
||||
}
|
||||
|
||||
Blocks.SKULL.checkWitherSpawn(worldObj, front, skullTile);
|
||||
Blocks.SKULL.checkWitherSpawn(getWorld(), front, skullTile);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -219,7 +219,7 @@ public class TileConstructor extends TileMultipartNode implements IComparable, I
|
||||
ItemStack took = network.extractItem(item, 1, false);
|
||||
|
||||
if (took != null) {
|
||||
BehaviorDefaultDispenseItem.doDispense(worldObj, took, 6, getDirection(), new PositionImpl(getDispensePositionX(), getDispensePositionY(), getDispensePositionZ()));
|
||||
BehaviorDefaultDispenseItem.doDispense(getWorld(), took, 6, getDirection(), new PositionImpl(getDispensePositionX(), getDispensePositionY(), getDispensePositionZ()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -316,7 +316,7 @@ public class TileConstructor extends TileMultipartNode implements IComparable, I
|
||||
|
||||
@Override
|
||||
public int getType() {
|
||||
return worldObj.isRemote ? TYPE.getValue() : type;
|
||||
return getWorld().isRemote ? TYPE.getValue() : type;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -111,7 +111,7 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR
|
||||
|
||||
for (INetworkNode node : tile.nodeGraph.all()) {
|
||||
if (node.canUpdate()) {
|
||||
IBlockState state = tile.worldObj.getBlockState(node.getPosition());
|
||||
IBlockState state = tile.getWorld().getBlockState(node.getPosition());
|
||||
|
||||
ClientNode clientNode = new ClientNode(
|
||||
new ItemStack(state.getBlock(), 1, state.getBlock().getMetaFromState(state)),
|
||||
@@ -225,7 +225,7 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR
|
||||
|
||||
@Override
|
||||
public boolean canRun() {
|
||||
return energy.getEnergyStored() > 0 && redstoneMode.isEnabled(worldObj, pos);
|
||||
return energy.getEnergyStored() > 0 && redstoneMode.isEnabled(getWorld(), pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -235,12 +235,12 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
if (!worldObj.isRemote) {
|
||||
if (!getWorld().isRemote) {
|
||||
energyEU.update();
|
||||
|
||||
if (!craftingTasksToRead.isEmpty()) {
|
||||
for (NBTTagCompound tag : craftingTasksToRead) {
|
||||
ICraftingTask task = readCraftingTask(worldObj, this, tag);
|
||||
ICraftingTask task = readCraftingTask(getWorld(), this, tag);
|
||||
|
||||
if (task != null) {
|
||||
addCraftingTask(task);
|
||||
@@ -492,7 +492,7 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR
|
||||
|
||||
@Override
|
||||
public void sendItemStorageToClient() {
|
||||
worldObj.getMinecraftServer().getPlayerList().getPlayerList().stream()
|
||||
getWorld().getMinecraftServer().getPlayerList().getPlayers().stream()
|
||||
.filter(player -> isWatchingGrid(player, EnumGridType.NORMAL, EnumGridType.CRAFTING, EnumGridType.PATTERN))
|
||||
.forEach(this::sendItemStorageToClient);
|
||||
}
|
||||
@@ -504,14 +504,14 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR
|
||||
|
||||
@Override
|
||||
public void sendItemStorageDeltaToClient(ItemStack stack, int delta) {
|
||||
worldObj.getMinecraftServer().getPlayerList().getPlayerList().stream()
|
||||
getWorld().getMinecraftServer().getPlayerList().getPlayers().stream()
|
||||
.filter(player -> isWatchingGrid(player, EnumGridType.NORMAL, EnumGridType.CRAFTING, EnumGridType.PATTERN))
|
||||
.forEach(player -> RS.INSTANCE.network.sendTo(new MessageGridItemDelta(this, stack, delta), player));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendFluidStorageToClient() {
|
||||
worldObj.getMinecraftServer().getPlayerList().getPlayerList().stream()
|
||||
getWorld().getMinecraftServer().getPlayerList().getPlayers().stream()
|
||||
.filter(player -> isWatchingGrid(player, EnumGridType.FLUID))
|
||||
.forEach(this::sendFluidStorageToClient);
|
||||
}
|
||||
@@ -523,7 +523,7 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR
|
||||
|
||||
@Override
|
||||
public void sendFluidStorageDeltaToClient(FluidStack stack, int delta) {
|
||||
worldObj.getMinecraftServer().getPlayerList().getPlayerList().stream()
|
||||
getWorld().getMinecraftServer().getPlayerList().getPlayers().stream()
|
||||
.filter(player -> isWatchingGrid(player, EnumGridType.FLUID))
|
||||
.forEach(player -> RS.INSTANCE.network.sendTo(new MessageGridFluidDelta(stack, delta), player));
|
||||
}
|
||||
@@ -547,7 +547,7 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR
|
||||
|
||||
@Override
|
||||
public void sendCraftingMonitorUpdate() {
|
||||
List<EntityPlayerMP> watchers = worldObj.getMinecraftServer().getPlayerList().getPlayerList().stream()
|
||||
List<EntityPlayerMP> watchers = getWorld().getMinecraftServer().getPlayerList().getPlayers().stream()
|
||||
.filter(player -> player.openContainer instanceof ContainerCraftingMonitor && pos.equals(((ContainerCraftingMonitor) player.openContainer).getCraftingMonitor().getNetworkPosition()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
@@ -592,7 +592,7 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR
|
||||
|
||||
@Override
|
||||
public void sendReaderWriterChannelUpdate() {
|
||||
worldObj.getMinecraftServer().getPlayerList().getPlayerList().stream()
|
||||
getWorld().getMinecraftServer().getPlayerList().getPlayers().stream()
|
||||
.filter(player -> player.openContainer instanceof ContainerReaderWriter &&
|
||||
((ContainerReaderWriter) player.openContainer).getReaderWriter().isConnected() &&
|
||||
pos.equals(((ContainerReaderWriter) player.openContainer).getReaderWriter().getNetwork().getPosition()))
|
||||
@@ -813,7 +813,7 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR
|
||||
|
||||
@Override
|
||||
public World getNetworkWorld() {
|
||||
return worldObj;
|
||||
return getWorld();
|
||||
}
|
||||
|
||||
public static ICraftingTask readCraftingTask(World world, INetworkMaster network, NBTTagCompound tag) {
|
||||
@@ -972,8 +972,8 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR
|
||||
}
|
||||
|
||||
public EnumControllerType getType() {
|
||||
if (type == null && worldObj.getBlockState(pos).getBlock() == RSBlocks.CONTROLLER) {
|
||||
this.type = (EnumControllerType) worldObj.getBlockState(pos).getValue(BlockController.TYPE);
|
||||
if (type == null && getWorld().getBlockState(pos).getBlock() == RSBlocks.CONTROLLER) {
|
||||
this.type = (EnumControllerType) getWorld().getBlockState(pos).getValue(BlockController.TYPE);
|
||||
}
|
||||
|
||||
return type == null ? EnumControllerType.NORMAL : type;
|
||||
|
||||
@@ -45,8 +45,8 @@ public class TileCrafter extends TileNode implements ICraftingPatternContainer {
|
||||
private ItemHandlerBasic patterns = new ItemHandlerBasic(9, this, s -> {
|
||||
// We can only validate the crafting pattern if the world exists.
|
||||
// If the world doesn't exist, this is probably called while reading and in that case it doesn't matter.
|
||||
if (worldObj != null) {
|
||||
return s.getItem() instanceof ICraftingPatternProvider && ((ICraftingPatternProvider) s.getItem()).create(worldObj, s, this).isValid();
|
||||
if (getWorld() != null) {
|
||||
return s.getItem() instanceof ICraftingPatternProvider && ((ICraftingPatternProvider) s.getItem()).create(getWorld(), s, this).isValid();
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -55,7 +55,7 @@ public class TileCrafter extends TileNode implements ICraftingPatternContainer {
|
||||
protected void onContentsChanged(int slot) {
|
||||
super.onContentsChanged(slot);
|
||||
|
||||
if (worldObj != null && !worldObj.isRemote) {
|
||||
if (getWorld() != null && !getWorld().isRemote) {
|
||||
rebuildPatterns();
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ public class TileCrafter extends TileNode implements ICraftingPatternContainer {
|
||||
ItemStack patternStack = patterns.getStackInSlot(i);
|
||||
|
||||
if (patternStack != null) {
|
||||
ICraftingPattern pattern = ((ICraftingPatternProvider) patternStack.getItem()).create(worldObj, patternStack, this);
|
||||
ICraftingPattern pattern = ((ICraftingPatternProvider) patternStack.getItem()).create(getWorld(), patternStack, this);
|
||||
|
||||
if (pattern.isValid()) {
|
||||
actualPatterns.add(pattern);
|
||||
@@ -106,7 +106,7 @@ public class TileCrafter extends TileNode implements ICraftingPatternContainer {
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
if (!worldObj.isRemote && ticks == 0) {
|
||||
if (!getWorld().isRemote && ticks == 0) {
|
||||
rebuildPatterns();
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ public class TileCrafter extends TileNode implements ICraftingPatternContainer {
|
||||
|
||||
@Override
|
||||
public void updateNode() {
|
||||
if (triggeredAutocrafting && worldObj.isBlockPowered(pos)) {
|
||||
if (triggeredAutocrafting && getWorld().isBlockPowered(pos)) {
|
||||
for (ICraftingPattern pattern : actualPatterns) {
|
||||
for (ItemStack output : pattern.getOutputs()) {
|
||||
network.scheduleCraftingTask(output, 1, IComparer.COMPARE_DAMAGE | IComparer.COMPARE_NBT);
|
||||
|
||||
@@ -106,7 +106,7 @@ public class TileDestructor extends TileMultipartNode implements IComparable, IF
|
||||
if (pickupItem && type == IType.ITEMS) {
|
||||
List<Entity> droppedItems = new ArrayList<>();
|
||||
|
||||
Chunk chunk = worldObj.getChunkFromBlockCoords(front);
|
||||
Chunk chunk = getWorld().getChunkFromBlockCoords(front);
|
||||
chunk.getEntitiesWithinAABBForEntity(null, new AxisAlignedBB(front), droppedItems, null);
|
||||
|
||||
for (Entity entity : droppedItems) {
|
||||
@@ -116,26 +116,26 @@ public class TileDestructor extends TileMultipartNode implements IComparable, IF
|
||||
if (IFilterable.canTake(itemFilters, mode, compare, droppedItem) && network.insertItem(droppedItem, droppedItem.stackSize, true) == null) {
|
||||
network.insertItem(droppedItem.copy(), droppedItem.stackSize, false);
|
||||
|
||||
worldObj.removeEntity(entity);
|
||||
getWorld().removeEntity(entity);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (type == IType.ITEMS) {
|
||||
IBlockState frontBlockState = worldObj.getBlockState(front);
|
||||
IBlockState frontBlockState = getWorld().getBlockState(front);
|
||||
Block frontBlock = frontBlockState.getBlock();
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
ItemStack frontStack = frontBlock.getItem(worldObj, front, frontBlockState);
|
||||
ItemStack frontStack = frontBlock.getItem(getWorld(), front, frontBlockState);
|
||||
|
||||
if (frontStack != null) {
|
||||
if (IFilterable.canTake(itemFilters, mode, compare, frontStack) && frontBlockState.getBlockHardness(worldObj, front) != -1.0) {
|
||||
if (IFilterable.canTake(itemFilters, mode, compare, frontStack) && frontBlockState.getBlockHardness(getWorld(), front) != -1.0) {
|
||||
List<ItemStack> drops;
|
||||
if (upgrades.hasUpgrade(ItemUpgrade.TYPE_SILK_TOUCH) && frontBlock.canSilkHarvest(worldObj, front, frontBlockState, null)) {
|
||||
if (upgrades.hasUpgrade(ItemUpgrade.TYPE_SILK_TOUCH) && frontBlock.canSilkHarvest(getWorld(), front, frontBlockState, null)) {
|
||||
drops = Collections.singletonList(frontStack);
|
||||
} else {
|
||||
drops = frontBlock.getDrops(worldObj, front, frontBlockState, upgrades.getFortuneLevel());
|
||||
drops = frontBlock.getDrops(getWorld(), front, frontBlockState, upgrades.getFortuneLevel());
|
||||
}
|
||||
|
||||
for (ItemStack drop : drops) {
|
||||
@@ -144,17 +144,17 @@ public class TileDestructor extends TileMultipartNode implements IComparable, IF
|
||||
}
|
||||
}
|
||||
|
||||
BlockEvent.BreakEvent e = new BlockEvent.BreakEvent(worldObj, front, frontBlockState, FakePlayerFactory.getMinecraft((WorldServer) worldObj));
|
||||
BlockEvent.BreakEvent e = new BlockEvent.BreakEvent(getWorld(), front, frontBlockState, FakePlayerFactory.getMinecraft((WorldServer) getWorld()));
|
||||
|
||||
if (!MinecraftForge.EVENT_BUS.post(e)) {
|
||||
worldObj.playEvent(null, 2001, front, Block.getStateId(frontBlockState));
|
||||
worldObj.setBlockToAir(front);
|
||||
getWorld().playEvent(null, 2001, front, Block.getStateId(frontBlockState));
|
||||
getWorld().setBlockToAir(front);
|
||||
|
||||
for (ItemStack drop : drops) {
|
||||
// We check if the controller isn't null here because when a destructor faces a node and removes it
|
||||
// it will essentially remove this block itself from the network without knowing
|
||||
if (network == null) {
|
||||
InventoryHelper.spawnItemStack(worldObj, front.getX(), front.getY(), front.getZ(), drop);
|
||||
InventoryHelper.spawnItemStack(getWorld(), front.getX(), front.getY(), front.getZ(), drop);
|
||||
} else {
|
||||
network.insertItem(drop, drop.stackSize, false);
|
||||
}
|
||||
@@ -163,14 +163,14 @@ public class TileDestructor extends TileMultipartNode implements IComparable, IF
|
||||
}
|
||||
}
|
||||
} else if (type == IType.FLUIDS) {
|
||||
Block frontBlock = worldObj.getBlockState(front).getBlock();
|
||||
Block frontBlock = getWorld().getBlockState(front).getBlock();
|
||||
|
||||
IFluidHandler handler = null;
|
||||
|
||||
if (frontBlock instanceof BlockLiquid) {
|
||||
handler = new BlockLiquidWrapper((BlockLiquid) frontBlock, worldObj, front);
|
||||
handler = new BlockLiquidWrapper((BlockLiquid) frontBlock, getWorld(), front);
|
||||
} else if (frontBlock instanceof IFluidBlock) {
|
||||
handler = new FluidBlockWrapper((IFluidBlock) frontBlock, worldObj, front);
|
||||
handler = new FluidBlockWrapper((IFluidBlock) frontBlock, getWorld(), front);
|
||||
}
|
||||
|
||||
if (handler != null) {
|
||||
@@ -285,7 +285,7 @@ public class TileDestructor extends TileMultipartNode implements IComparable, IF
|
||||
|
||||
@Override
|
||||
public int getType() {
|
||||
return worldObj.isRemote ? TYPE.getValue() : type;
|
||||
return getWorld().isRemote ? TYPE.getValue() : type;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -156,7 +156,7 @@ public class TileDetector extends TileNode implements IComparable, IType {
|
||||
if (powered != wasPowered) {
|
||||
wasPowered = powered;
|
||||
|
||||
worldObj.notifyNeighborsOfStateChange(pos, RSBlocks.DETECTOR);
|
||||
getWorld().notifyNeighborsOfStateChange(pos, RSBlocks.DETECTOR);
|
||||
|
||||
updateBlock();
|
||||
}
|
||||
@@ -278,7 +278,7 @@ public class TileDetector extends TileNode implements IComparable, IType {
|
||||
|
||||
@Override
|
||||
public int getType() {
|
||||
return worldObj.isRemote ? TYPE.getValue() : type;
|
||||
return getWorld().isRemote ? TYPE.getValue() : type;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -554,7 +554,7 @@ public class TileDiskDrive extends TileNode implements IItemStorageProvider, IFl
|
||||
|
||||
@Override
|
||||
public int getType() {
|
||||
return worldObj.isRemote ? TYPE.getValue() : type;
|
||||
return getWorld().isRemote ? TYPE.getValue() : type;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -172,7 +172,7 @@ public class TileExporter extends TileMultipartNode implements IComparable, ITyp
|
||||
|
||||
@Override
|
||||
public int getType() {
|
||||
return worldObj.isRemote ? TYPE.getValue() : type;
|
||||
return getWorld().isRemote ? TYPE.getValue() : type;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -50,7 +50,7 @@ public class TileFluidInterface extends TileNode implements IComparable {
|
||||
protected void onContentsChanged() {
|
||||
super.onContentsChanged();
|
||||
|
||||
if (worldObj != null && !worldObj.isRemote) {
|
||||
if (getWorld() != null && !getWorld().isRemote) {
|
||||
dataManager.sendParameterToWatchers(TANK_IN);
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public class TileFluidInterface extends TileNode implements IComparable {
|
||||
protected void onContentsChanged() {
|
||||
super.onContentsChanged();
|
||||
|
||||
if (worldObj != null && !worldObj.isRemote) {
|
||||
if (getWorld() != null && !getWorld().isRemote) {
|
||||
dataManager.sendParameterToWatchers(TANK_OUT);
|
||||
}
|
||||
|
||||
|
||||
@@ -202,8 +202,8 @@ public class TileFluidStorage extends TileNode implements IFluidStorageProvider,
|
||||
}
|
||||
|
||||
public EnumFluidStorageType getType() {
|
||||
if (type == null && worldObj.getBlockState(pos).getBlock() == RSBlocks.FLUID_STORAGE) {
|
||||
this.type = ((EnumFluidStorageType) worldObj.getBlockState(pos).getValue(BlockFluidStorage.TYPE));
|
||||
if (type == null && getWorld().getBlockState(pos).getBlock() == RSBlocks.FLUID_STORAGE) {
|
||||
this.type = ((EnumFluidStorageType) getWorld().getBlockState(pos).getValue(BlockFluidStorage.TYPE));
|
||||
}
|
||||
|
||||
return type == null ? EnumFluidStorageType.TYPE_64K : type;
|
||||
|
||||
@@ -195,7 +195,7 @@ public class TileImporter extends TileMultipartNode implements IComparable, IFil
|
||||
|
||||
@Override
|
||||
public int getType() {
|
||||
return worldObj.isRemote ? TYPE.getValue() : type;
|
||||
return getWorld().isRemote ? TYPE.getValue() : type;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -71,8 +71,8 @@ public abstract class TileMultipartNode extends TileNode implements IMicroblockC
|
||||
|
||||
if (network != null) {
|
||||
network.getNodeGraph().rebuild();
|
||||
} else if (worldObj != null) {
|
||||
RSBlocks.CABLE.attemptConnect(worldObj, pos);
|
||||
} else if (getWorld() != null) {
|
||||
RSBlocks.CABLE.attemptConnect(getWorld(), pos);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ public abstract class TileMultipartNode extends TileNode implements IMicroblockC
|
||||
|
||||
@Override
|
||||
public boolean canConduct(EnumFacing direction) {
|
||||
return !hasBlockingMicroblock(worldObj, pos, direction) && !hasBlockingMicroblock(worldObj, pos.offset(direction), direction.getOpposite());
|
||||
return !hasBlockingMicroblock(getWorld(), pos, direction) && !hasBlockingMicroblock(getWorld(), pos.offset(direction), direction.getOpposite());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -145,7 +145,7 @@ public class TileNetworkTransmitter extends TileNode {
|
||||
}
|
||||
|
||||
public boolean isSameDimension() {
|
||||
return worldObj.provider.getDimension() == receiverDimension;
|
||||
return getWorld().provider.getDimension() == receiverDimension;
|
||||
}
|
||||
|
||||
public boolean isDimensionSupported() {
|
||||
|
||||
@@ -35,7 +35,7 @@ public abstract class TileNode extends TileBase implements INetworkNode, IRedsto
|
||||
|
||||
@Override
|
||||
public boolean canUpdate() {
|
||||
return redstoneMode.isEnabled(worldObj, pos);
|
||||
return redstoneMode.isEnabled(getWorld(), pos);
|
||||
}
|
||||
|
||||
public boolean isActive() {
|
||||
@@ -46,9 +46,9 @@ public abstract class TileNode extends TileBase implements INetworkNode, IRedsto
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
if (!worldObj.isRemote) {
|
||||
if (!getWorld().isRemote) {
|
||||
if (networkPos != null) {
|
||||
TileEntity tile = worldObj.getTileEntity(networkPos);
|
||||
TileEntity tile = getWorld().getTileEntity(networkPos);
|
||||
|
||||
if (tile instanceof INetworkMaster) {
|
||||
((INetworkMaster) tile).getNodeGraph().replace(this);
|
||||
@@ -119,7 +119,7 @@ public abstract class TileNode extends TileBase implements INetworkNode, IRedsto
|
||||
|
||||
@Override
|
||||
public World getNodeWorld() {
|
||||
return worldObj;
|
||||
return getWorld();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -60,7 +60,7 @@ public class TileReader extends TileMultipartNode implements IReader {
|
||||
|
||||
@Override
|
||||
public int getRedstoneStrength() {
|
||||
return worldObj.getRedstonePower(pos.offset(getDirection()), getDirection());
|
||||
return getWorld().getRedstonePower(pos.offset(getDirection()), getDirection());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -203,8 +203,8 @@ public class TileStorage extends TileNode implements IItemStorageProvider, IStor
|
||||
}
|
||||
|
||||
public EnumItemStorageType getType() {
|
||||
if (type == null && worldObj.getBlockState(pos).getBlock() == RSBlocks.STORAGE) {
|
||||
this.type = ((EnumItemStorageType) worldObj.getBlockState(pos).getValue(BlockStorage.TYPE));
|
||||
if (type == null && getWorld().getBlockState(pos).getBlock() == RSBlocks.STORAGE) {
|
||||
this.type = ((EnumItemStorageType) getWorld().getBlockState(pos).getValue(BlockStorage.TYPE));
|
||||
}
|
||||
|
||||
return type == null ? EnumItemStorageType.TYPE_1K : type;
|
||||
|
||||
@@ -35,10 +35,10 @@ public class TileWriter extends TileMultipartNode implements IWriter {
|
||||
public void update() {
|
||||
super.update();
|
||||
|
||||
if (!worldObj.isRemote && getRedstoneStrength() != lastRedstoneStrength) {
|
||||
if (!getWorld().isRemote && getRedstoneStrength() != lastRedstoneStrength) {
|
||||
lastRedstoneStrength = getRedstoneStrength();
|
||||
|
||||
worldObj.notifyNeighborsOfStateChange(pos, RSBlocks.WRITER);
|
||||
getWorld().notifyNeighborsOfStateChange(pos, RSBlocks.WRITER);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ public class TileWriter extends TileMultipartNode implements IWriter {
|
||||
public void setDirection(EnumFacing direction) {
|
||||
super.setDirection(direction);
|
||||
|
||||
worldObj.notifyNeighborsOfStateChange(pos, RSBlocks.WRITER);
|
||||
getWorld().notifyNeighborsOfStateChange(pos, RSBlocks.WRITER);
|
||||
}
|
||||
|
||||
public void onOpened(EntityPlayer entity) {
|
||||
|
||||
@@ -55,7 +55,7 @@ public final class RSSerializers {
|
||||
buf.writeBoolean(true);
|
||||
ByteBufUtils.writeUTF8String(buf, FluidRegistry.getFluidName(value));
|
||||
buf.writeInt(value.amount);
|
||||
buf.writeNBTTagCompoundToBuffer(value.tag);
|
||||
buf.writeCompoundTag(value.tag);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public final class RSSerializers {
|
||||
public FluidStack read(PacketBuffer buf) {
|
||||
try {
|
||||
if (buf.readBoolean()) {
|
||||
return new FluidStack(FluidRegistry.getFluid(ByteBufUtils.readUTF8String(buf)), buf.readInt(), buf.readNBTTagCompoundFromBuffer());
|
||||
return new FluidStack(FluidRegistry.getFluid(ByteBufUtils.readUTF8String(buf)), buf.readInt(), buf.readCompoundTag());
|
||||
}
|
||||
} catch (IOException e) {
|
||||
// NO OP
|
||||
|
||||
@@ -127,7 +127,7 @@ public class TileExternalStorage extends TileMultipartNode implements IItemStora
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
if (!worldObj.isRemote && network != null) {
|
||||
if (!getWorld().isRemote && network != null) {
|
||||
if (networkTicks++ == 0) {
|
||||
updateStorage(network);
|
||||
|
||||
@@ -351,7 +351,7 @@ public class TileExternalStorage extends TileMultipartNode implements IItemStora
|
||||
|
||||
@Override
|
||||
public int getType() {
|
||||
return worldObj.isRemote ? TYPE.getValue() : type;
|
||||
return getWorld().isRemote ? TYPE.getValue() : type;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -202,8 +202,8 @@ public class TileGrid extends TileNode implements IGrid {
|
||||
}
|
||||
|
||||
public EnumGridType getType() {
|
||||
if (type == null && worldObj.getBlockState(pos).getBlock() == RSBlocks.GRID) {
|
||||
this.type = (EnumGridType) worldObj.getBlockState(pos).getValue(BlockGrid.TYPE);
|
||||
if (type == null && getWorld().getBlockState(pos).getBlock() == RSBlocks.GRID) {
|
||||
this.type = (EnumGridType) getWorld().getBlockState(pos).getValue(BlockGrid.TYPE);
|
||||
}
|
||||
|
||||
return type == null ? EnumGridType.NORMAL : type;
|
||||
@@ -264,11 +264,11 @@ public class TileGrid extends TileNode implements IGrid {
|
||||
public void onCraftingMatrixChanged() {
|
||||
markDirty();
|
||||
|
||||
result.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(matrix, worldObj));
|
||||
result.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(matrix, getWorld()));
|
||||
}
|
||||
|
||||
public void onCrafted(EntityPlayer player) {
|
||||
ItemStack[] remainder = CraftingManager.getInstance().getRemainingItems(matrix, worldObj);
|
||||
ItemStack[] remainder = CraftingManager.getInstance().getRemainingItems(matrix, getWorld());
|
||||
|
||||
for (int i = 0; i < matrix.getSizeInventory(); ++i) {
|
||||
ItemStack slot = matrix.getStackInSlot(i);
|
||||
@@ -280,7 +280,7 @@ public class TileGrid extends TileNode implements IGrid {
|
||||
ItemStack remainderStack = network.insertItem(remainder[i].copy(), remainder[i].stackSize, false);
|
||||
|
||||
if (remainderStack != null) {
|
||||
InventoryHelper.spawnItemStack(player.worldObj, player.getPosition().getX(), player.getPosition().getY(), player.getPosition().getZ(), remainderStack);
|
||||
InventoryHelper.spawnItemStack(player.getEntityWorld(), player.getPosition().getX(), player.getPosition().getY(), player.getPosition().getZ(), remainderStack);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -321,7 +321,7 @@ public class TileGrid extends TileNode implements IGrid {
|
||||
if (!player.inventory.addItemStackToInventory(craftedItem.copy())) {
|
||||
ItemStack remainder = network.insertItem(craftedItem, craftedItem.stackSize, false);
|
||||
if (remainder != null) {
|
||||
InventoryHelper.spawnItemStack(player.worldObj, player.getPosition().getX(), player.getPosition().getY(), player.getPosition().getZ(), remainder);
|
||||
InventoryHelper.spawnItemStack(player.getEntityWorld(), player.getPosition().getX(), player.getPosition().getY(), player.getPosition().getZ(), remainder);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -435,22 +435,22 @@ public class TileGrid extends TileNode implements IGrid {
|
||||
|
||||
@Override
|
||||
public int getViewType() {
|
||||
return worldObj.isRemote ? VIEW_TYPE.getValue() : viewType;
|
||||
return getWorld().isRemote ? VIEW_TYPE.getValue() : viewType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSortingDirection() {
|
||||
return worldObj.isRemote ? SORTING_DIRECTION.getValue() : sortingDirection;
|
||||
return getWorld().isRemote ? SORTING_DIRECTION.getValue() : sortingDirection;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSortingType() {
|
||||
return worldObj.isRemote ? SORTING_TYPE.getValue() : sortingType;
|
||||
return getWorld().isRemote ? SORTING_TYPE.getValue() : sortingType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSearchBoxMode() {
|
||||
return worldObj.isRemote ? SEARCH_BOX_MODE.getValue() : searchBoxMode;
|
||||
return getWorld().isRemote ? SEARCH_BOX_MODE.getValue() : searchBoxMode;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user