Version bump + small improvements
This commit is contained in:
@@ -12,7 +12,7 @@ buildscript {
|
||||
}
|
||||
apply plugin: 'net.minecraftforge.gradle.forge'
|
||||
|
||||
version = "0.7.12"
|
||||
version = "0.7.13"
|
||||
group = "refinedstorage"
|
||||
archivesBaseName = "refinedstorage"
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import refinedstorage.proxy.CommonProxy;
|
||||
@Mod(modid = RefinedStorage.ID, version = RefinedStorage.VERSION)
|
||||
public final class RefinedStorage {
|
||||
public static final String ID = "refinedstorage";
|
||||
public static final String VERSION = "0.7.12";
|
||||
public static final String VERSION = "0.7.13";
|
||||
|
||||
public static final SimpleNetworkWrapper NETWORK = NetworkRegistry.INSTANCE.newSimpleChannel(ID);
|
||||
|
||||
|
||||
@@ -28,6 +28,6 @@ public class SlotGridCraftingResult extends SlotCrafting {
|
||||
|
||||
onCrafting(stack);
|
||||
|
||||
grid.onCrafted(container);
|
||||
grid.onCrafted(container, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ public class GuiGrid extends GuiBase {
|
||||
}
|
||||
|
||||
public boolean isHoveringOverCreatePattern(int mouseX, int mouseY) {
|
||||
return grid.getType() == EnumGridType.PATTERN && inBounds(152, 124, 16, 16, mouseX, mouseY) && ((TileGrid) grid).mayCreatePattern();
|
||||
return grid.getType() == EnumGridType.PATTERN && inBounds(152, 124, 16, 16, mouseX, mouseY) && ((TileGrid) grid).canCreatePattern();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -207,7 +207,7 @@ public class GuiGrid extends GuiBase {
|
||||
ty = 1;
|
||||
}
|
||||
|
||||
if (!((TileGrid) grid).mayCreatePattern()) {
|
||||
if (!((TileGrid) grid).canCreatePattern()) {
|
||||
ty = 2;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,12 +10,12 @@ import refinedstorage.tile.TileProcessingPatternEncoder;
|
||||
import java.io.IOException;
|
||||
|
||||
public class GuiProcessingPatternEncoder extends GuiBase {
|
||||
private TileProcessingPatternEncoder ppEncoder;
|
||||
private TileProcessingPatternEncoder processingPatternEncoder;
|
||||
|
||||
public GuiProcessingPatternEncoder(ContainerProcessingPatternEncoder container, TileProcessingPatternEncoder ppEncoder) {
|
||||
public GuiProcessingPatternEncoder(ContainerProcessingPatternEncoder container, TileProcessingPatternEncoder processingPatternEncoder) {
|
||||
super(container, 176, 172);
|
||||
|
||||
this.ppEncoder = ppEncoder;
|
||||
this.processingPatternEncoder = processingPatternEncoder;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -27,7 +27,7 @@ public class GuiProcessingPatternEncoder extends GuiBase {
|
||||
}
|
||||
|
||||
public boolean isHoveringOverCreatePattern(int mouseX, int mouseY) {
|
||||
return inBounds(152, 38, 16, 16, mouseX, mouseY) && ppEncoder.mayCreatePattern();
|
||||
return inBounds(152, 38, 16, 16, mouseX, mouseY) && processingPatternEncoder.canCreatePattern();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -42,7 +42,7 @@ public class GuiProcessingPatternEncoder extends GuiBase {
|
||||
ty = 1;
|
||||
}
|
||||
|
||||
if (!ppEncoder.mayCreatePattern()) {
|
||||
if (!processingPatternEncoder.canCreatePattern()) {
|
||||
ty = 2;
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ public class GuiProcessingPatternEncoder extends GuiBase {
|
||||
super.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
|
||||
if (isHoveringOverCreatePattern(mouseX - guiLeft, mouseY - guiTop)) {
|
||||
RefinedStorage.NETWORK.sendToServer(new MessageGridPatternCreate(ppEncoder.getPos().getX(), ppEncoder.getPos().getY(), ppEncoder.getPos().getZ()));
|
||||
RefinedStorage.NETWORK.sendToServer(new MessageGridPatternCreate(processingPatternEncoder.getPos().getX(), processingPatternEncoder.getPos().getY(), processingPatternEncoder.getPos().getZ()));
|
||||
|
||||
mc.getSoundHandler().playSound(PositionedSoundRecord.getMasterRecord(SoundEvents.UI_BUTTON_CLICK, 1.0F));
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public class MessageWirelessGridCraftingStart extends MessageHandlerPlayerToServ
|
||||
public void handle(MessageWirelessGridCraftingStart message, EntityPlayerMP player) {
|
||||
TileEntity tile = player.worldObj.getTileEntity(new BlockPos(message.controllerX, message.controllerY, message.controllerZ));
|
||||
|
||||
if (tile instanceof TileController && ((TileController) tile).mayRun()) {
|
||||
if (tile instanceof TileController && ((TileController) tile).canRun()) {
|
||||
((TileController) tile).getStorageHandler().handleCraftingRequest(message.id, message.quantity);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public class MessageWirelessGridStoragePull extends MessageHandlerPlayerToServer
|
||||
public void handle(MessageWirelessGridStoragePull message, EntityPlayerMP player) {
|
||||
TileEntity tile = player.worldObj.getTileEntity(new BlockPos(message.controllerX, message.controllerY, message.controllerZ));
|
||||
|
||||
if (tile instanceof TileController && ((TileController) tile).mayRun()) {
|
||||
if (tile instanceof TileController && ((TileController) tile).canRun()) {
|
||||
((TileController) tile).getStorageHandler().handlePull(message.id, message.flags, player);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public class MessageWirelessGridStoragePush extends MessageHandlerPlayerToServer
|
||||
public void handle(MessageWirelessGridStoragePush message, EntityPlayerMP player) {
|
||||
TileEntity tile = player.worldObj.getTileEntity(new BlockPos(message.controllerX, message.controllerY, message.controllerZ));
|
||||
|
||||
if (tile instanceof TileController && ((TileController) tile).mayRun()) {
|
||||
if (tile instanceof TileController && ((TileController) tile).canRun()) {
|
||||
((TileController) tile).getStorageHandler().handlePush(message.playerSlot, message.one, player);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ public class TileCable extends TileMachine {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean maySendConnectivityData() {
|
||||
public boolean canSendConnectivityData() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ public abstract class TileMachine extends TileBase implements ISynchronizedConta
|
||||
searchController(worldObj);
|
||||
}
|
||||
|
||||
if (wasConnected != isActive() && maySendConnectivityData()) {
|
||||
if (wasConnected != isActive() && canSendConnectivityData()) {
|
||||
wasConnected = isActive();
|
||||
|
||||
RefinedStorageUtils.updateBlock(worldObj, pos);
|
||||
@@ -68,16 +68,16 @@ public abstract class TileMachine extends TileBase implements ISynchronizedConta
|
||||
super.update();
|
||||
}
|
||||
|
||||
public boolean maySendConnectivityData() {
|
||||
public boolean canSendConnectivityData() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean mayUpdate() {
|
||||
public boolean canUpdate() {
|
||||
return redstoneMode.isEnabled(worldObj, pos);
|
||||
}
|
||||
|
||||
public boolean isActive() {
|
||||
return connected && mayUpdate();
|
||||
return connected && canUpdate();
|
||||
}
|
||||
|
||||
public void onConnected(World world, TileController controller) {
|
||||
@@ -87,7 +87,7 @@ public abstract class TileMachine extends TileBase implements ISynchronizedConta
|
||||
}
|
||||
|
||||
private boolean tryConnect(TileController controller) {
|
||||
if (!controller.mayRun()) {
|
||||
if (!controller.canRun()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ public class TileProcessingPatternEncoder extends TileBase {
|
||||
}
|
||||
|
||||
public void onCreatePattern() {
|
||||
if (mayCreatePattern()) {
|
||||
if (canCreatePattern()) {
|
||||
ItemStack pattern = new ItemStack(RefinedStorageItems.PATTERN);
|
||||
|
||||
ItemPattern.setProcessing(pattern, true);
|
||||
@@ -55,7 +55,7 @@ public class TileProcessingPatternEncoder extends TileBase {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean mayCreatePattern() {
|
||||
public boolean canCreatePattern() {
|
||||
int inputsFilled = 0, outputsFilled = 0;
|
||||
|
||||
for (int i = 0; i < 9; ++i) {
|
||||
|
||||
@@ -24,8 +24,8 @@ public class TileRelay extends TileMachine {
|
||||
public void update() {
|
||||
super.update();
|
||||
|
||||
if (connected && couldUpdate != mayUpdate()) {
|
||||
couldUpdate = mayUpdate();
|
||||
if (connected && couldUpdate != canUpdate()) {
|
||||
couldUpdate = canUpdate();
|
||||
|
||||
worldObj.notifyNeighborsOfStateChange(pos, RefinedStorageBlocks.RELAY);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ public final class ControllerSearcher {
|
||||
if (tile instanceof TileController) {
|
||||
return (TileController) tile;
|
||||
} else if (tile instanceof TileMachine) {
|
||||
if (visited.size() > 1 && tile instanceof TileRelay && !((TileRelay) tile).mayUpdate()) {
|
||||
if (visited.size() > 1 && tile instanceof TileRelay && !((TileRelay) tile).canUpdate()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ public class TileController extends TileBase implements IEnergyReceiver, ISynchr
|
||||
|
||||
int lastEnergy = energy.getEnergyStored();
|
||||
|
||||
if (mayRun()) {
|
||||
if (canRun()) {
|
||||
if (ticks % 20 == 0) {
|
||||
syncMachines();
|
||||
}
|
||||
@@ -129,8 +129,8 @@ public class TileController extends TileBase implements IEnergyReceiver, ISynchr
|
||||
syncMachines();
|
||||
}
|
||||
|
||||
if (couldRun != mayRun()) {
|
||||
couldRun = mayRun();
|
||||
if (couldRun != canRun()) {
|
||||
couldRun = canRun();
|
||||
|
||||
worldObj.notifyNeighborsOfStateChange(pos, RefinedStorageBlocks.CONTROLLER);
|
||||
}
|
||||
@@ -292,7 +292,7 @@ public class TileController extends TileBase implements IEnergyReceiver, ISynchr
|
||||
this.patterns.clear();
|
||||
|
||||
for (TileMachine machine : machines) {
|
||||
if (!machine.mayUpdate()) {
|
||||
if (!machine.canUpdate()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -599,7 +599,7 @@ public class TileController extends TileBase implements IEnergyReceiver, ISynchr
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean mayRun() {
|
||||
public boolean canRun() {
|
||||
return energy.getEnergyStored() > 0 && energy.getEnergyStored() >= energyUsage && redstoneMode.isEnabled(worldObj, pos);
|
||||
}
|
||||
|
||||
@@ -654,7 +654,7 @@ public class TileController extends TileBase implements IEnergyReceiver, ISynchr
|
||||
List<ClientMachine> m = new ArrayList<ClientMachine>();
|
||||
|
||||
for (TileMachine machine : machines) {
|
||||
if (machine.mayUpdate()) {
|
||||
if (machine.canUpdate()) {
|
||||
IBlockState state = worldObj.getBlockState(machine.getPos());
|
||||
|
||||
ClientMachine clientMachine = new ClientMachine();
|
||||
|
||||
@@ -137,7 +137,7 @@ public class TileGrid extends TileMachine implements IGrid {
|
||||
result.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(matrix, worldObj));
|
||||
}
|
||||
|
||||
public void onCrafted(ContainerGrid container) {
|
||||
public void onCrafted(ContainerGrid container, boolean sendChanges) {
|
||||
if (!worldObj.isRemote) {
|
||||
ItemStack[] remainder = CraftingManager.getInstance().getRemainingItems(matrix, worldObj);
|
||||
|
||||
@@ -159,9 +159,11 @@ public class TileGrid extends TileMachine implements IGrid {
|
||||
|
||||
onCraftingMatrixChanged();
|
||||
|
||||
if (sendChanges) {
|
||||
container.detectAndSendChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onCraftedShift(ContainerGrid container, EntityPlayer player) {
|
||||
List<ItemStack> craftedItemsList = new ArrayList<ItemStack>();
|
||||
@@ -169,7 +171,7 @@ public class TileGrid extends TileMachine implements IGrid {
|
||||
ItemStack crafted = result.getStackInSlot(0);
|
||||
|
||||
while (true) {
|
||||
onCrafted(container);
|
||||
onCrafted(container, false);
|
||||
|
||||
craftedItemsList.add(crafted.copy());
|
||||
|
||||
@@ -190,7 +192,7 @@ public class TileGrid extends TileMachine implements IGrid {
|
||||
}
|
||||
|
||||
public void onCreatePattern() {
|
||||
if (mayCreatePattern()) {
|
||||
if (canCreatePattern()) {
|
||||
patterns.extractItem(0, 1, false);
|
||||
|
||||
ItemStack pattern = new ItemStack(RefinedStorageItems.PATTERN);
|
||||
@@ -217,7 +219,7 @@ public class TileGrid extends TileMachine implements IGrid {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean mayCreatePattern() {
|
||||
public boolean canCreatePattern() {
|
||||
return result.getStackInSlot(0) != null && patterns.getStackInSlot(1) == null && patterns.getStackInSlot(0) != null;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"modid": "refinedstorage",
|
||||
"name": "Refined Storage",
|
||||
"description": "A Minecraft mod all about storage.",
|
||||
"version": "0.7.12",
|
||||
"version": "0.7.13",
|
||||
"mcversion": "1.9.4",
|
||||
"url": "",
|
||||
"updateUrl": "",
|
||||
|
||||
Reference in New Issue
Block a user