Inital cable rendering

This only took 2 hours :/
This commit is contained in:
modmuss50 2016-03-05 10:48:13 +00:00
parent 0b04bb8c69
commit e3c150c06e
7 changed files with 77 additions and 35 deletions

View file

@ -6,6 +6,7 @@ import mcmultipart.multipart.*;
import net.minecraft.block.Block;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
@ -48,6 +49,7 @@ public class CableMultipart extends Multipart implements IOccludingPart, ISlotte
public static final IUnlistedProperty EAST = Properties.toUnlisted(PropertyBool.create("east"));
public static final IUnlistedProperty SOUTH = Properties.toUnlisted(PropertyBool.create("south"));
public static final IUnlistedProperty WEST = Properties.toUnlisted(PropertyBool.create("west"));
public static final IProperty TYPE = PropertyEnum.create("type", CableTypes.class);
public CableMultipart() {
connectedSides = new HashMap<>();
@ -470,13 +472,16 @@ public class CableMultipart extends Multipart implements IOccludingPart, ISlotte
.withProperty(NORTH, shouldConnectTo(EnumFacing.NORTH))
.withProperty(SOUTH, shouldConnectTo(EnumFacing.SOUTH))
.withProperty(WEST, shouldConnectTo(EnumFacing.WEST))
.withProperty(EAST, shouldConnectTo(EnumFacing.EAST));
.withProperty(EAST, shouldConnectTo(EnumFacing.EAST))
.withProperty(TYPE, CableTypes.COPPER);
}
@Override
public BlockState createBlockState() {
return new ExtendedBlockState(MCMultiPartMod.multipart,
new IProperty[0],
new IProperty[]{
TYPE
},
new IUnlistedProperty[]{
DOWN,
UP,

View file

@ -0,0 +1,22 @@
package techreborn.parts;
import net.minecraft.util.IStringSerializable;
/**
* Created by Mark on 05/03/2016.
*/
public enum CableTypes implements IStringSerializable {
COPPER("copper"),
TIN("tin");
private String friendlyName;
CableTypes(String friendlyName) {
this.friendlyName = friendlyName;
}
@Override
public String getName() {
return friendlyName;
}
}

View file

@ -27,7 +27,7 @@ public class TechRebornParts implements ICompatModule {
@Override
public void init(FMLInitializationEvent event) {
MultipartRegistry.registerPart(CableMultipart.class, "techreborn:cablepart");
MultipartRegistry.registerPart(CableMultipart.class, "techreborn:cable");
cables = new ItemCables();
GameRegistry.registerItem(cables, "cables");
}