This commit is contained in:
Raoul Van den Berge
2016-07-09 16:34:15 +02:00
parent e9af6647d9
commit 8fdcd98dbf
65 changed files with 50 additions and 71 deletions

View File

@@ -30,8 +30,4 @@ public class BlockCraftingMonitor extends BlockNode {
return true;
}
public boolean hasConnectivityState() {
return true;
}
}

View File

@@ -70,13 +70,4 @@ public class BlockGrid extends BlockNode {
public Item createItem() {
return new ItemBlockBase(this, true);
}
public boolean hasConnectivityState() {
return true;
}
@Override
public EnumPlacementType getPlacementType() {
return EnumPlacementType.ANY;
}
}

View File

@@ -47,6 +47,6 @@ public enum EnumStorageType implements IStringSerializable {
return type;
}
}
return TYPE_1K;
return TYPE_CREATIVE;
}
}

View File

@@ -1,6 +1,7 @@
package refinedstorage.item;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.InventoryHelper;
import net.minecraft.item.ItemStack;
@@ -64,6 +65,15 @@ public class ItemBlockStorage extends ItemBlockBase {
return stack.getTagCompound() != null && stack.getTagCompound().hasKey(TileStorage.NBT_STORAGE);
}
@Override
public void onUpdate(ItemStack stack, World world, Entity entity, int slot, boolean selected) {
super.onUpdate(stack, world, entity, slot, selected);
if (!stack.hasTagCompound()) {
initNBT(stack);
}
}
@Override
public void onCreated(ItemStack stack, World world, EntityPlayer player) {
super.onCreated(stack, world, player);

View File

@@ -2,6 +2,7 @@ package refinedstorage.item;
import net.minecraft.client.resources.I18n;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.InventoryHelper;
import net.minecraft.item.Item;
@@ -39,14 +40,25 @@ public class ItemStorageDisk extends ItemBase {
@Override
public void getSubItems(Item item, CreativeTabs tab, List list) {
for (int i = 0; i < 6; ++i) {
list.add(i == TYPE_DEBUG ? createDebugDisk() : NBTStorage.createStackWithNBT(new ItemStack(item, 1, i)));
for (int i = 0; i < 5; ++i) {
list.add(NBTStorage.createStackWithNBT(new ItemStack(item, 1, i)));
}
}
private ItemStack createDebugDisk() {
ItemStack debugDisk = new ItemStack(RefinedStorageItems.STORAGE_DISK, 1, ItemStorageDisk.TYPE_DEBUG);
@Override
public void onUpdate(ItemStack stack, World world, Entity entity, int slot, boolean selected) {
super.onUpdate(stack, world, entity, slot, selected);
if (!stack.hasTagCompound()) {
if (stack.getItemDamage() == 5) {
applyDebugDiskData(stack);
} else {
NBTStorage.createStackWithNBT(stack);
}
}
}
private void applyDebugDiskData(ItemStack stack) {
if (debugDiskTag == null) {
debugDiskTag = NBTStorage.createNBT();
@@ -76,9 +88,7 @@ public class ItemStorageDisk extends ItemBase {
storage.writeToNBT();
}
debugDisk.setTagCompound(debugDiskTag.copy());
return debugDisk;
stack.setTagCompound(debugDiskTag.copy());
}
@Override

View File

@@ -107,6 +107,10 @@ public class ClientProxy extends CommonProxy {
.build()
);
ModelLoader.setCustomStateMapper(RefinedStorageBlocks.GRID, (new StateMap.Builder())
.ignore(RefinedStorageBlocks.GRID.TYPE)
.build());
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.CABLE), 0, new ModelResourceLocation("refinedstorage:cable", "inventory"));
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.GRID), EnumGridType.NORMAL.getId(), new ModelResourceLocation("refinedstorage:grid", "inventory"));
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.GRID), EnumGridType.CRAFTING.getId(), new ModelResourceLocation("refinedstorage:grid", "inventory"));

View File

@@ -86,10 +86,11 @@ public class CommonProxy {
registerBlock(RefinedStorageBlocks.PROCESSING_PATTERN_ENCODER);
registerBlock(RefinedStorageBlocks.DISK_DRIVE);
registerBlock(RefinedStorageBlocks.STORAGE);
registerBlock(RefinedStorageBlocks.EXTERNAL_STORAGE);
registerBlock(RefinedStorageBlocks.SOLDERER);
registerBlock(RefinedStorageBlocks.CABLE);
registerBlock(RefinedStorageBlocks.IMPORTER);
registerBlock(RefinedStorageBlocks.EXPORTER);
registerBlock(RefinedStorageBlocks.EXTERNAL_STORAGE);
registerBlock(RefinedStorageBlocks.CONSTRUCTOR);
registerBlock(RefinedStorageBlocks.DESTRUCTOR);
registerBlock(RefinedStorageBlocks.DETECTOR);
@@ -98,7 +99,6 @@ public class CommonProxy {
registerBlock(RefinedStorageBlocks.WIRELESS_TRANSMITTER);
registerBlock(RefinedStorageBlocks.MACHINE_CASING);
registerBlock(RefinedStorageBlocks.QUARTZ_ENRICHED_IRON);
registerBlock(RefinedStorageBlocks.CABLE);
registerItem(RefinedStorageItems.QUARTZ_ENRICHED_IRON);
registerItem(RefinedStorageItems.STORAGE_DISK);

View File

@@ -252,15 +252,17 @@ public class TileDiskDrive extends TileNode implements IStorageProvider, IStorag
ItemStack disk = disks.getStackInSlot(i);
if (disk != null) {
int capacity = EnumStorageType.getById(disk.getItemDamage()).getCapacity();
if (capacity == -1) {
return 0;
}
stored += NBTStorage.getStoredFromNBT(disk.getTagCompound());
storedMax += EnumStorageType.getById(disk.getItemDamage()).getCapacity();
}
}
if (storedMax == 0) {
return 0;
}
return (int) Math.floor((stored / storedMax) * 7f);
}

View File

@@ -335,6 +335,7 @@ public class TileGrid extends TileNode implements IGrid {
public void writeContainerData(ByteBuf buf) {
super.writeContainerData(buf);
buf.writeBoolean(isConnected());
buf.writeInt(sortingDirection);
buf.writeInt(sortingType);
buf.writeInt(searchBoxMode);
@@ -344,6 +345,7 @@ public class TileGrid extends TileNode implements IGrid {
public void readContainerData(ByteBuf buf) {
super.readContainerData(buf);
connected = buf.readBoolean();
sortingDirection = buf.readInt();
sortingType = buf.readInt();
searchBoxMode = buf.readInt();

View File

@@ -4,31 +4,17 @@
"model": "orientable",
"textures": {
"side": "refinedstorage:blocks/side",
"top": "refinedstorage:blocks/side"
"top": "refinedstorage:blocks/side",
"front": "refinedstorage:blocks/crafting_monitor"
}
},
"variants": {
"inventory": [
{
"textures": {
"front": "refinedstorage:blocks/crafting_monitor_disconnected"
},
"transform": "forge:default-block",
"y": 0
}
],
"connected": {
"true": {
"textures": {
"front": "refinedstorage:blocks/crafting_monitor_connected"
}
},
"false": {
"textures": {
"front": "refinedstorage:blocks/crafting_monitor_disconnected"
}
}
},
"direction": {
"north": {
"y": 0

View File

@@ -4,39 +4,17 @@
"model": "orientable",
"textures": {
"side": "refinedstorage:blocks/side",
"top": "refinedstorage:blocks/side"
"top": "refinedstorage:blocks/side",
"front": "refinedstorage:blocks/grid"
}
},
"variants": {
"inventory": [
{
"textures": {
"front": "refinedstorage:blocks/grid_disconnected"
},
"transform": "forge:default-block",
"y": 0
}
],
"type": {
"normal": {
},
"crafting": {
},
"pattern": {
}
},
"connected": {
"true": {
"textures": {
"front": "refinedstorage:blocks/grid_connected"
}
},
"false": {
"textures": {
"front": "refinedstorage:blocks/grid_disconnected"
}
}
},
"direction": {
"north": {
"y": 0

View File

@@ -6,10 +6,10 @@
"particle": "refinedstorage:blocks/processing_pattern_encoder",
"down": "refinedstorage:blocks/side",
"up": "refinedstorage:blocks/processing_pattern_encoder",
"north": "refinedstorage:blocks/side",
"east": "refinedstorage:blocks/side",
"south": "refinedstorage:blocks/side",
"west": "refinedstorage:blocks/side"
"north": "refinedstorage:blocks/processing_pattern_encoder_side",
"east": "refinedstorage:blocks/processing_pattern_encoder_side",
"south": "refinedstorage:blocks/processing_pattern_encoder_side",
"west": "refinedstorage:blocks/processing_pattern_encoder_side"
}
},
"variants": {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 652 B

After

Width:  |  Height:  |  Size: 503 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 638 B

After

Width:  |  Height:  |  Size: 492 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 651 B

After

Width:  |  Height:  |  Size: 495 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 645 B

After

Width:  |  Height:  |  Size: 502 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 658 B

After

Width:  |  Height:  |  Size: 331 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 679 B

After

Width:  |  Height:  |  Size: 481 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 679 B

After

Width:  |  Height:  |  Size: 450 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 731 B

After

Width:  |  Height:  |  Size: 455 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 704 B

After

Width:  |  Height:  |  Size: 514 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 697 B

After

Width:  |  Height:  |  Size: 482 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 460 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 663 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 661 B

After

Width:  |  Height:  |  Size: 517 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 668 B

After

Width:  |  Height:  |  Size: 479 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 502 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 687 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 614 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 655 B

After

Width:  |  Height:  |  Size: 503 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 648 B

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 415 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 601 B

After

Width:  |  Height:  |  Size: 452 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 585 B

After

Width:  |  Height:  |  Size: 448 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 567 B

After

Width:  |  Height:  |  Size: 370 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 509 B

After

Width:  |  Height:  |  Size: 499 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 712 B

After

Width:  |  Height:  |  Size: 514 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 521 B

After

Width:  |  Height:  |  Size: 547 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 593 B

After

Width:  |  Height:  |  Size: 530 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 516 B

After

Width:  |  Height:  |  Size: 506 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 771 B

After

Width:  |  Height:  |  Size: 585 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 509 B

After

Width:  |  Height:  |  Size: 499 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 769 B

After

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 520 B

After

Width:  |  Height:  |  Size: 411 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 607 B

After

Width:  |  Height:  |  Size: 502 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 500 B

After

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 569 B

After

Width:  |  Height:  |  Size: 467 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 471 B

After

Width:  |  Height:  |  Size: 411 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 512 B

After

Width:  |  Height:  |  Size: 401 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 551 B

After

Width:  |  Height:  |  Size: 547 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 479 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 476 B

After

Width:  |  Height:  |  Size: 417 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 522 B

After

Width:  |  Height:  |  Size: 399 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 612 B

After

Width:  |  Height:  |  Size: 499 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 483 B

After

Width:  |  Height:  |  Size: 474 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 419 B

After

Width:  |  Height:  |  Size: 334 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 516 B

After

Width:  |  Height:  |  Size: 404 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 445 B

After

Width:  |  Height:  |  Size: 381 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 465 B

After

Width:  |  Height:  |  Size: 354 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 509 B

After

Width:  |  Height:  |  Size: 387 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 476 B

After

Width:  |  Height:  |  Size: 482 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 516 B

After

Width:  |  Height:  |  Size: 456 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 685 B

After

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 615 B

After

Width:  |  Height:  |  Size: 409 B