Add constructor destructor model, fix issue with setting storage on client

This commit is contained in:
Raoul Van den Berge
2016-07-10 21:48:32 +02:00
parent a57e9e8e9b
commit f9c4eb4def
14 changed files with 1352 additions and 36 deletions

View File

@@ -2,10 +2,15 @@
### 0.8.9 ### 0.8.9
**Bugfixes** **Bugfixes**
- Several models / texture tweaks
- Fixed bug where Grid doesn't handle remainder sometimes - Fixed bug where Grid doesn't handle remainder sometimes
- Fixed caching issues with External Storage - Fixed caching issues with External Storage
**Features**
- Added a model for the Constructor
- Added a model for the Destructor
- Wireless Transmitters next to each other without any cable or without being connected to a machine won't work anymore, they need to be explictly connected to a cable or other machine
- Several models / texture tweaks
### 0.8.8 ### 0.8.8
**Bugfixes** **Bugfixes**
- Use ore dictionary for recipes with glass - Use ore dictionary for recipes with glass

View File

@@ -43,7 +43,7 @@ public abstract class NBTStorage implements IStorage {
/** /**
* @param tag The NBT tag we are reading from and writing the amount stored to, has to be initialized with {@link NBTStorage#createNBT()} if it doesn't exist yet * @param tag The NBT tag we are reading from and writing the amount stored to, has to be initialized with {@link NBTStorage#createNBT()} if it doesn't exist yet
* @param capacity The capacity of this storage, -1 for infinite capacity * @param capacity The capacity of this storage, -1 for infinite capacity
* @param tile A {@link TileEntity} that the NBT storage is in, will be marked dirty when storage changes * @param tile A {@link TileEntity} that the NBT storage is in, will be marked dirty when the storage changes
*/ */
public NBTStorage(NBTTagCompound tag, int capacity, @Nullable TileEntity tile) { public NBTStorage(NBTTagCompound tag, int capacity, @Nullable TileEntity tile) {
this.tag = tag; this.tag = tag;

View File

@@ -12,7 +12,7 @@ import refinedstorage.RefinedStorage;
import refinedstorage.RefinedStorageGui; import refinedstorage.RefinedStorageGui;
import refinedstorage.tile.TileConstructor; import refinedstorage.tile.TileConstructor;
public class BlockConstructor extends BlockNode { public class BlockConstructor extends BlockCable {
public BlockConstructor() { public BlockConstructor() {
super("constructor"); super("constructor");
} }

View File

@@ -12,7 +12,7 @@ import refinedstorage.RefinedStorage;
import refinedstorage.RefinedStorageGui; import refinedstorage.RefinedStorageGui;
import refinedstorage.tile.TileDestructor; import refinedstorage.tile.TileDestructor;
public class BlockDestructor extends BlockNode { public class BlockDestructor extends BlockCable {
public BlockDestructor() { public BlockDestructor() {
super("destructor"); super("destructor");
} }

View File

@@ -6,6 +6,8 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumFacing;
import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.ItemHandlerHelper; import net.minecraftforge.items.ItemHandlerHelper;
@@ -56,16 +58,21 @@ public class TileDiskDrive extends TileNode implements IStorageProvider, IStorag
protected void onContentsChanged(int slot) { protected void onContentsChanged(int slot) {
super.onContentsChanged(slot); super.onContentsChanged(slot);
ItemStack disk = getStackInSlot(slot); /**
* Can't use {@link net.minecraft.world.World#isRemote} here because when {@link TileDiskDrive#readFromNBT(NBTTagCompound)} is called there is no world set yet.
*/
if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER) {
ItemStack disk = getStackInSlot(slot);
if (disk == null) { if (disk == null) {
storages[slot] = null; storages[slot] = null;
} else { } else {
storages[slot] = new Storage(disk); storages[slot] = new Storage(disk);
} }
if (network != null) { if (network != null) {
network.getStorage().rebuild(); network.getStorage().rebuild();
}
} }
} }

View File

@@ -1,38 +1,80 @@
{ {
"forge_marker": 1, "forge_marker": 1,
"defaults": { "defaults": {
"model": "orientable",
"textures": { "textures": {
"side": "refinedstorage:blocks/side", "all": "refinedstorage:blocks/cable",
"top": "refinedstorage:blocks/side", "particle": "refinedstorage:blocks/cable"
"front": "refinedstorage:blocks/constructor" },
} "model": "refinedstorage:cable_core",
"uvlock": true
}, },
"variants": { "variants": {
"inventory": [ "inventory": [
{ {
"y": 0, "model": "refinedstorage:constructor_destructor",
"transform": "forge:default-block" "transform": "forge:default-block"
} }
], ],
"direction": { "direction": {
"north": { "north": {
"y": 0 "submodel": "refinedstorage:constructor_destructor_north"
}, },
"east": { "east": {
"y": 90 "submodel": "refinedstorage:constructor_destructor_east"
}, },
"south": { "south": {
"y": 180 "submodel": "refinedstorage:constructor_destructor_south"
}, },
"west": { "west": {
"y": 270 "submodel": "refinedstorage:constructor_destructor_west"
}, },
"up": { "up": {
"x": 270 "submodel": "refinedstorage:constructor_destructor_up"
}, },
"down": { "down": {
"x": 90 "submodel": "refinedstorage:constructor_destructor_down"
}
},
"north": {
"true": {
"submodel": "refinedstorage:cable_north"
},
"false": {
}
},
"east": {
"true": {
"submodel": "refinedstorage:cable_east"
},
"false": {
}
},
"south": {
"true": {
"submodel": "refinedstorage:cable_south"
},
"false": {
}
},
"west": {
"true": {
"submodel": "refinedstorage:cable_west"
},
"false": {
}
},
"up": {
"true": {
"submodel": "refinedstorage:cable_up"
},
"false": {
}
},
"down": {
"true": {
"submodel": "refinedstorage:cable_down"
},
"false": {
} }
} }
} }

View File

@@ -1,38 +1,80 @@
{ {
"forge_marker": 1, "forge_marker": 1,
"defaults": { "defaults": {
"model": "orientable",
"textures": { "textures": {
"side": "refinedstorage:blocks/side", "all": "refinedstorage:blocks/cable",
"top": "refinedstorage:blocks/side", "particle": "refinedstorage:blocks/cable"
"front": "refinedstorage:blocks/destructor" },
} "model": "refinedstorage:cable_core",
"uvlock": true
}, },
"variants": { "variants": {
"inventory": [ "inventory": [
{ {
"y": 0, "model": "refinedstorage:constructor_destructor",
"transform": "forge:default-block" "transform": "forge:default-block"
} }
], ],
"direction": { "direction": {
"north": { "north": {
"y": 0 "submodel": "refinedstorage:constructor_destructor_north"
}, },
"east": { "east": {
"y": 90 "submodel": "refinedstorage:constructor_destructor_east"
}, },
"south": { "south": {
"y": 180 "submodel": "refinedstorage:constructor_destructor_south"
}, },
"west": { "west": {
"y": 270 "submodel": "refinedstorage:constructor_destructor_west"
}, },
"up": { "up": {
"x": 270 "submodel": "refinedstorage:constructor_destructor_up"
}, },
"down": { "down": {
"x": 90 "submodel": "refinedstorage:constructor_destructor_down"
}
},
"north": {
"true": {
"submodel": "refinedstorage:cable_north"
},
"false": {
}
},
"east": {
"true": {
"submodel": "refinedstorage:cable_east"
},
"false": {
}
},
"south": {
"true": {
"submodel": "refinedstorage:cable_south"
},
"false": {
}
},
"west": {
"true": {
"submodel": "refinedstorage:cable_west"
},
"false": {
}
},
"up": {
"true": {
"submodel": "refinedstorage:cable_up"
},
"false": {
}
},
"down": {
"true": {
"submodel": "refinedstorage:cable_down"
},
"false": {
} }
} }
} }

View File

@@ -0,0 +1,350 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"elements": [
{
"name": "Line1",
"from": [
7.0,
7.0,
2.0
],
"to": [
9.0,
9.0,
6.0
],
"faces": {
"north": {
"texture": "#line",
"uv": [
0.0,
0.0,
4.0,
4.0
]
},
"east": {
"texture": "#line",
"uv": [
0.0,
0.0,
2.0,
4.0
]
},
"south": {
"texture": "#line",
"uv": [
0.0,
0.0,
4.0,
4.0
]
},
"west": {
"texture": "#line",
"uv": [
0.0,
0.0,
2.0,
4.0
]
},
"up": {
"texture": "#line",
"uv": [
0.0,
0.0,
4.0,
2.0
]
},
"down": {
"texture": "#line",
"uv": [
0.0,
0.0,
4.0,
2.0
]
}
}
},
{
"name": "Line2",
"from": [
0.0,
0.0,
0.0
],
"to": [
16.0,
16.0,
2.0
],
"faces": {
"north": {
"texture": "#line",
"uv": [
0.0,
0.0,
10.0,
10.0
]
},
"east": {
"texture": "#line",
"uv": [
0.0,
0.0,
2.0,
10.0
]
},
"south": {
"texture": "#line",
"uv": [
0.0,
0.0,
10.0,
10.0
]
},
"west": {
"texture": "#line",
"uv": [
0.0,
0.0,
2.0,
10.0
]
},
"up": {
"texture": "#line",
"uv": [
0.0,
0.0,
10.0,
2.0
]
},
"down": {
"texture": "#line",
"uv": [
0.0,
0.0,
10.0,
2.0
]
}
}
},
{
"name": "Core",
"from": [
6.0,
6.0,
6.0
],
"to": [
10.0,
10.0,
10.0
],
"faces": {
"north": {
"texture": "#all",
"uv": [
4.0,
4.0,
8.0,
8.0
]
},
"east": {
"texture": "#all",
"uv": [
0.0,
4.0,
4.0,
8.0
]
},
"south": {
"texture": "#all",
"uv": [
12.0,
4.0,
16.0,
8.0
]
},
"west": {
"texture": "#all",
"uv": [
8.0,
4.0,
12.0,
8.0
]
},
"up": {
"texture": "#all",
"uv": [
8.0,
4.0,
4.0,
0.0
]
},
"down": {
"texture": "#all",
"uv": [
12.0,
0.0,
8.0,
4.0
]
}
}
},
{
"name": "East",
"from": [
10.0,
6.0,
6.0
],
"to": [
16.0,
10.0,
10.0
],
"faces": {
"north": {
"texture": "#all",
"uv": [
4.0,
4.0,
8.0,
8.0
]
},
"east": {
"texture": "#all",
"uv": [
0.0,
4.0,
4.0,
8.0
]
},
"south": {
"texture": "#all",
"uv": [
12.0,
4.0,
16.0,
8.0
]
},
"west": {
"texture": "#all",
"uv": [
8.0,
4.0,
12.0,
8.0
]
},
"up": {
"texture": "#all",
"uv": [
8.0,
4.0,
4.0,
0.0
]
},
"down": {
"texture": "#all",
"uv": [
12.0,
0.0,
8.0,
4.0
]
}
}
},
{
"name": "West",
"from": [
0.0,
6.0,
6.0
],
"to": [
6.0,
10.0,
10.0
],
"faces": {
"north": {
"texture": "#all",
"uv": [
4.0,
4.0,
8.0,
8.0
]
},
"east": {
"texture": "#all",
"uv": [
0.0,
4.0,
4.0,
8.0
]
},
"south": {
"texture": "#all",
"uv": [
12.0,
4.0,
16.0,
8.0
]
},
"west": {
"texture": "#all",
"uv": [
8.0,
4.0,
12.0,
8.0
]
},
"up": {
"texture": "#all",
"uv": [
8.0,
4.0,
4.0,
0.0
]
},
"down": {
"texture": "#all",
"uv": [
12.0,
0.0,
8.0,
4.0
]
}
}
}
]
}

View File

@@ -0,0 +1,145 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"textures": {
},
"elements": [
{
"name": "Line1",
"from": [
7.0,
2.0,
7.0
],
"to": [
9.0,
6.0,
9.0
],
"faces": {
"north": {
"texture": "#ine",
"uv": [
0.0,
0.0,
4.0,
4.0
]
},
"east": {
"texture": "#ine",
"uv": [
0.0,
0.0,
2.0,
4.0
]
},
"south": {
"texture": "#ine",
"uv": [
0.0,
0.0,
4.0,
4.0
]
},
"west": {
"texture": "#ine",
"uv": [
0.0,
0.0,
2.0,
4.0
]
},
"up": {
"texture": "#ine",
"uv": [
0.0,
0.0,
4.0,
2.0
]
},
"down": {
"texture": "#ine",
"uv": [
0.0,
0.0,
4.0,
2.0
]
}
}
},
{
"name": "Line2",
"from": [
0.0,
0.0,
0.0
],
"to": [
16.0,
2.0,
16.0
],
"faces": {
"north": {
"texture": "#ine",
"uv": [
0.0,
0.0,
10.0,
10.0
]
},
"east": {
"texture": "#ine",
"uv": [
0.0,
0.0,
2.0,
10.0
]
},
"south": {
"texture": "#ine",
"uv": [
0.0,
0.0,
10.0,
10.0
]
},
"west": {
"texture": "#ine",
"uv": [
0.0,
0.0,
2.0,
10.0
]
},
"up": {
"texture": "#ine",
"uv": [
0.0,
0.0,
10.0,
2.0
]
},
"down": {
"texture": "#ine",
"uv": [
0.0,
0.0,
10.0,
2.0
]
}
}
}
]
}

View File

@@ -0,0 +1,145 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"textures": {
},
"elements": [
{
"name": "Line1",
"from": [
10.0,
7.0,
7.0
],
"to": [
14.0,
9.0,
9.0
],
"faces": {
"north": {
"texture": "#line",
"uv": [
0.0,
0.0,
4.0,
4.0
]
},
"east": {
"texture": "#line",
"uv": [
0.0,
0.0,
2.0,
4.0
]
},
"south": {
"texture": "#line",
"uv": [
0.0,
0.0,
4.0,
4.0
]
},
"west": {
"texture": "#line",
"uv": [
0.0,
0.0,
2.0,
4.0
]
},
"up": {
"texture": "#line",
"uv": [
0.0,
0.0,
4.0,
2.0
]
},
"down": {
"texture": "#line",
"uv": [
0.0,
0.0,
4.0,
2.0
]
}
}
},
{
"name": "Line2",
"from": [
14.0,
0.0,
0.0
],
"to": [
16.0,
16.0,
16.0
],
"faces": {
"north": {
"texture": "#line",
"uv": [
0.0,
0.0,
10.0,
10.0
]
},
"east": {
"texture": "#line",
"uv": [
0.0,
0.0,
2.0,
10.0
]
},
"south": {
"texture": "#line",
"uv": [
0.0,
0.0,
10.0,
10.0
]
},
"west": {
"texture": "#line",
"uv": [
0.0,
0.0,
2.0,
10.0
]
},
"up": {
"texture": "#line",
"uv": [
0.0,
0.0,
10.0,
2.0
]
},
"down": {
"texture": "#line",
"uv": [
0.0,
0.0,
10.0,
2.0
]
}
}
}
]
}

View File

@@ -0,0 +1,145 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"textures": {
},
"elements": [
{
"name": "Line1",
"from": [
7.0,
7.0,
2.0
],
"to": [
9.0,
9.0,
6.0
],
"faces": {
"north": {
"texture": "#line",
"uv": [
0.0,
0.0,
4.0,
4.0
]
},
"east": {
"texture": "#line",
"uv": [
0.0,
0.0,
2.0,
4.0
]
},
"south": {
"texture": "#line",
"uv": [
0.0,
0.0,
4.0,
4.0
]
},
"west": {
"texture": "#line",
"uv": [
0.0,
0.0,
2.0,
4.0
]
},
"up": {
"texture": "#line",
"uv": [
0.0,
0.0,
4.0,
2.0
]
},
"down": {
"texture": "#line",
"uv": [
0.0,
0.0,
4.0,
2.0
]
}
}
},
{
"name": "Line2",
"from": [
0.0,
0.0,
0.0
],
"to": [
16.0,
16.0,
2.0
],
"faces": {
"north": {
"texture": "#line",
"uv": [
0.0,
0.0,
10.0,
10.0
]
},
"east": {
"texture": "#line",
"uv": [
0.0,
0.0,
2.0,
10.0
]
},
"south": {
"texture": "#line",
"uv": [
0.0,
0.0,
10.0,
10.0
]
},
"west": {
"texture": "#line",
"uv": [
0.0,
0.0,
2.0,
10.0
]
},
"up": {
"texture": "#line",
"uv": [
0.0,
0.0,
10.0,
2.0
]
},
"down": {
"texture": "#line",
"uv": [
0.0,
0.0,
10.0,
2.0
]
}
}
}
]
}

View File

@@ -0,0 +1,145 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"textures": {
},
"elements": [
{
"name": "Line1",
"from": [
7.0,
7.0,
10.0
],
"to": [
9.0,
9.0,
14.0
],
"faces": {
"north": {
"texture": "#line",
"uv": [
0.0,
0.0,
4.0,
4.0
]
},
"east": {
"texture": "#line",
"uv": [
0.0,
0.0,
2.0,
4.0
]
},
"south": {
"texture": "#line",
"uv": [
0.0,
0.0,
4.0,
4.0
]
},
"west": {
"texture": "#line",
"uv": [
0.0,
0.0,
2.0,
4.0
]
},
"up": {
"texture": "#line",
"uv": [
0.0,
0.0,
4.0,
2.0
]
},
"down": {
"texture": "#line",
"uv": [
0.0,
0.0,
4.0,
2.0
]
}
}
},
{
"name": "Line2",
"from": [
0.0,
0.0,
14.0
],
"to": [
16.0,
16.0,
16.0
],
"faces": {
"north": {
"texture": "#line",
"uv": [
0.0,
0.0,
10.0,
10.0
]
},
"east": {
"texture": "#line",
"uv": [
0.0,
0.0,
2.0,
10.0
]
},
"south": {
"texture": "#line",
"uv": [
0.0,
0.0,
10.0,
10.0
]
},
"west": {
"texture": "#line",
"uv": [
0.0,
0.0,
2.0,
10.0
]
},
"up": {
"texture": "#line",
"uv": [
0.0,
0.0,
10.0,
2.0
]
},
"down": {
"texture": "#line",
"uv": [
0.0,
0.0,
10.0,
2.0
]
}
}
}
]
}

View File

@@ -0,0 +1,145 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"textures": {
},
"elements": [
{
"name": "Line1",
"from": [
7.0,
10.0,
7.0
],
"to": [
9.0,
14.0,
9.0
],
"faces": {
"north": {
"texture": "#line",
"uv": [
0.0,
0.0,
4.0,
4.0
]
},
"east": {
"texture": "#line",
"uv": [
0.0,
0.0,
2.0,
4.0
]
},
"south": {
"texture": "#line",
"uv": [
0.0,
0.0,
4.0,
4.0
]
},
"west": {
"texture": "#line",
"uv": [
0.0,
0.0,
2.0,
4.0
]
},
"up": {
"texture": "#line",
"uv": [
0.0,
0.0,
4.0,
2.0
]
},
"down": {
"texture": "#line",
"uv": [
0.0,
0.0,
4.0,
2.0
]
}
}
},
{
"name": "Line2",
"from": [
0.0,
14.0,
0.0
],
"to": [
16.0,
16.0,
16.0
],
"faces": {
"north": {
"texture": "#line",
"uv": [
0.0,
0.0,
10.0,
10.0
]
},
"east": {
"texture": "#line",
"uv": [
0.0,
0.0,
2.0,
10.0
]
},
"south": {
"texture": "#line",
"uv": [
0.0,
0.0,
10.0,
10.0
]
},
"west": {
"texture": "#line",
"uv": [
0.0,
0.0,
2.0,
10.0
]
},
"up": {
"texture": "#line",
"uv": [
0.0,
0.0,
10.0,
2.0
]
},
"down": {
"texture": "#line",
"uv": [
0.0,
0.0,
10.0,
2.0
]
}
}
}
]
}

View File

@@ -0,0 +1,145 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"textures": {
},
"elements": [
{
"name": "Line1",
"from": [
2.0,
7.0,
7.0
],
"to": [
6.0,
9.0,
9.0
],
"faces": {
"north": {
"texture": "#line",
"uv": [
0.0,
0.0,
4.0,
4.0
]
},
"east": {
"texture": "#line",
"uv": [
0.0,
0.0,
2.0,
4.0
]
},
"south": {
"texture": "#line",
"uv": [
0.0,
0.0,
4.0,
4.0
]
},
"west": {
"texture": "#line",
"uv": [
0.0,
0.0,
2.0,
4.0
]
},
"up": {
"texture": "#line",
"uv": [
0.0,
0.0,
4.0,
2.0
]
},
"down": {
"texture": "#line",
"uv": [
0.0,
0.0,
4.0,
2.0
]
}
}
},
{
"name": "Line2",
"from": [
0.0,
0.0,
0.0
],
"to": [
2.0,
16.0,
16.0
],
"faces": {
"north": {
"texture": "#line",
"uv": [
0.0,
0.0,
10.0,
10.0
]
},
"east": {
"texture": "#line",
"uv": [
0.0,
0.0,
2.0,
10.0
]
},
"south": {
"texture": "#line",
"uv": [
0.0,
0.0,
10.0,
10.0
]
},
"west": {
"texture": "#line",
"uv": [
0.0,
0.0,
2.0,
10.0
]
},
"up": {
"texture": "#line",
"uv": [
0.0,
0.0,
10.0,
2.0
]
},
"down": {
"texture": "#line",
"uv": [
0.0,
0.0,
10.0,
2.0
]
}
}
}
]
}