Fixed cables rendering
This commit is contained in:
parent
7a005f7494
commit
f02b24f813
6 changed files with 112 additions and 108 deletions
|
@ -22,7 +22,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.blocks.generator.solarpanel;
|
||||
package techreborn.blocks.generator;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
|
@ -24,24 +24,17 @@
|
|||
|
||||
package techreborn.client;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.block.statemap.DefaultStateMapper;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.blocks.cable.BlockCable;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRItems;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class RegisterItemJsons {
|
||||
public static void registerModels() {
|
||||
TRContent.registerModel();
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package techreborn.init;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.block.statemap.DefaultStateMapper;
|
||||
|
@ -23,13 +24,16 @@ import techreborn.blocks.BlockMachineFrame;
|
|||
import techreborn.blocks.BlockOre;
|
||||
import techreborn.blocks.BlockStorage;
|
||||
import techreborn.blocks.cable.BlockCable;
|
||||
import techreborn.blocks.generator.solarpanel.BlockSolarPanel;
|
||||
import techreborn.blocks.generator.BlockSolarPanel;
|
||||
import techreborn.blocks.tier1.BlockElectricFurnace;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.items.ItemUpgrade;
|
||||
import techreborn.utils.InitUtils;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
@RebornRegister(modID = TechReborn.MOD_ID)
|
||||
public class TRContent {
|
||||
|
@ -132,16 +136,18 @@ public class TRContent {
|
|||
|
||||
ResourceLocation cableRL = new ResourceLocation(TechReborn.MOD_ID, "cable_inv");
|
||||
for (Cables value : Cables.values()) {
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(value.block), 0, new ModelResourceLocation(cableRL, "type=" + value.name));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(value.block), 0,
|
||||
new ModelResourceLocation(cableRL, "type=" + value.name));
|
||||
ModelLoader.setCustomStateMapper(value.block, new DefaultStateMapper() {
|
||||
@Override
|
||||
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
|
||||
return new ModelResourceLocation(new ResourceLocation(TechReborn.MOD_ID, "cable_" + (value.cableThickness == 5 ? "thick" : "thin")), "type=" + value.name);
|
||||
Map<IProperty<?>, Comparable<?>> map = Maps.newLinkedHashMap(state.getProperties());
|
||||
String property = this.getPropertyString(map) + ",ztype=" + value.name;
|
||||
|
||||
return new ModelResourceLocation(new ResourceLocation(TechReborn.MOD_ID,
|
||||
"cable_" + (value.cableThickness == 5 ? "thick" : "thin")), property);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ import reborncore.api.power.EnumPowerTier;
|
|||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.blocks.generator.solarpanel.BlockSolarPanel;
|
||||
import techreborn.blocks.generator.BlockSolarPanel;
|
||||
import techreborn.init.TRContent.SolarPanels;
|
||||
|
||||
import java.util.List;
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
"false": {
|
||||
}
|
||||
},
|
||||
"type": {
|
||||
"ztype": {
|
||||
"insulated_copper": {
|
||||
"textures": {
|
||||
"cable": "techreborn:blocks/cables/copper_insulated_cable"
|
||||
|
|
|
@ -1,94 +1,99 @@
|
|||
{
|
||||
"forge_marker": 1,
|
||||
"defaults": {
|
||||
"transform": "forge:default-block",
|
||||
"model": "techreborn:cable_thin",
|
||||
"textures": {
|
||||
"particle": "#cable"
|
||||
}
|
||||
},
|
||||
"variants": {
|
||||
"inventory": [{} ],
|
||||
"down": {
|
||||
"true": {
|
||||
"submodel": {
|
||||
"pipeDown": {
|
||||
"model": "techreborn:cable_connection_alt_thin",
|
||||
"x": 270
|
||||
}
|
||||
}
|
||||
},
|
||||
"false": {
|
||||
}
|
||||
},
|
||||
"east": {
|
||||
"true": {
|
||||
"submodel": "techreborn:cable_connection_thin",
|
||||
"y": 90
|
||||
},
|
||||
"false": {
|
||||
}
|
||||
},
|
||||
"north": {
|
||||
"true": {
|
||||
"submodel": "techreborn:cable_connection_thin"
|
||||
},
|
||||
"false": {
|
||||
}
|
||||
},
|
||||
"south": {
|
||||
"true": {
|
||||
"submodel": "techreborn:cable_connection_alt_thin"
|
||||
},
|
||||
"false": {
|
||||
}
|
||||
},
|
||||
"up": {
|
||||
"true": {
|
||||
"submodel": {
|
||||
"pipeUp": {
|
||||
"model": "techreborn:cable_connection_thin",
|
||||
"x": 270
|
||||
}
|
||||
}
|
||||
},
|
||||
"false": {
|
||||
}
|
||||
},
|
||||
"west": {
|
||||
"true": {
|
||||
"submodel": "techreborn:cable_connection_alt_thin",
|
||||
"y": 90
|
||||
},
|
||||
"false": {
|
||||
}
|
||||
},
|
||||
"type": {
|
||||
"copper": {
|
||||
"textures": {
|
||||
"cable": "techreborn:blocks/cables/copper_cable"
|
||||
}
|
||||
},
|
||||
"tin": {
|
||||
"textures": {
|
||||
"cable": "techreborn:blocks/cables/tin_cable"
|
||||
}
|
||||
},
|
||||
"gold": {
|
||||
"textures": {
|
||||
"cable": "techreborn:blocks/cables/gold_cable"
|
||||
}
|
||||
},
|
||||
"hv": {
|
||||
"textures": {
|
||||
"cable": "techreborn:blocks/cables/hv_cable"
|
||||
}
|
||||
},
|
||||
"glassfiber": {
|
||||
"textures": {
|
||||
"cable": "techreborn:blocks/cables/glass_fiber_cable"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"forge_marker": 1,
|
||||
"defaults": {
|
||||
"transform": "forge:default-block",
|
||||
"model": "techreborn:cable_thin",
|
||||
"textures": {
|
||||
"particle": "#cable"
|
||||
}
|
||||
},
|
||||
"variants": {
|
||||
"down": {
|
||||
"true": {
|
||||
"submodel": {
|
||||
"pipeDown": {
|
||||
"model": "techreborn:cable_connection_alt_thin",
|
||||
"x": 270
|
||||
}
|
||||
}
|
||||
},
|
||||
"false": {
|
||||
|
||||
}
|
||||
},
|
||||
"east": {
|
||||
"true": {
|
||||
"submodel": "techreborn:cable_connection_thin",
|
||||
"y": 90
|
||||
},
|
||||
"false": {
|
||||
|
||||
}
|
||||
},
|
||||
"north": {
|
||||
"true": {
|
||||
"submodel": "techreborn:cable_connection_thin"
|
||||
},
|
||||
"false": {
|
||||
|
||||
}
|
||||
},
|
||||
"south": {
|
||||
"true": {
|
||||
"submodel": "techreborn:cable_connection_alt_thin"
|
||||
},
|
||||
"false": {
|
||||
|
||||
}
|
||||
},
|
||||
"up": {
|
||||
"true": {
|
||||
"submodel": {
|
||||
"pipeUp": {
|
||||
"model": "techreborn:cable_connection_thin",
|
||||
"x": 270
|
||||
}
|
||||
}
|
||||
},
|
||||
"false": {
|
||||
|
||||
}
|
||||
},
|
||||
"west": {
|
||||
"true": {
|
||||
"submodel": "techreborn:cable_connection_alt_thin",
|
||||
"y": 90
|
||||
},
|
||||
"false": {
|
||||
|
||||
}
|
||||
},
|
||||
"ztype": {
|
||||
"copper": {
|
||||
"textures": {
|
||||
"cable": "techreborn:blocks/cables/copper_cable"
|
||||
}
|
||||
},
|
||||
"tin": {
|
||||
"textures": {
|
||||
"cable": "techreborn:blocks/cables/tin_cable"
|
||||
}
|
||||
},
|
||||
"gold": {
|
||||
"textures": {
|
||||
"cable": "techreborn:blocks/cables/gold_cable"
|
||||
}
|
||||
},
|
||||
"hv": {
|
||||
"textures": {
|
||||
"cable": "techreborn:blocks/cables/hv_cable"
|
||||
}
|
||||
},
|
||||
"glassfiber": {
|
||||
"textures": {
|
||||
"cable": "techreborn:blocks/cables/glass_fiber_cable"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue