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