mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-12-22 19:39:24 +01:00
ITEMS AND BLOCKS RENDER
Well. Not all of them.
This commit is contained in:
parent
c08d2221fa
commit
77860267da
4 changed files with 41 additions and 13 deletions
|
@ -135,16 +135,16 @@ public class BlockSmileyCloud extends BlockContainerBase{
|
|||
int rotation = MathHelper.floor_double((double)(player.rotationYaw*4.0F/360.0F)+0.5D) & 3;
|
||||
|
||||
if(rotation == 0){
|
||||
PosUtil.setMetadata(pos, world, 0, 2);
|
||||
PosUtil.setMetadata(pos, world, 2, 2);
|
||||
}
|
||||
if(rotation == 1){
|
||||
PosUtil.setMetadata(pos, world, 3, 2);
|
||||
}
|
||||
if(rotation == 2){
|
||||
PosUtil.setMetadata(pos, world, 1, 2);
|
||||
}
|
||||
if(rotation == 2){
|
||||
PosUtil.setMetadata(pos, world, 0, 2);
|
||||
}
|
||||
if(rotation == 3){
|
||||
PosUtil.setMetadata(pos, world, 2, 2);
|
||||
PosUtil.setMetadata(pos, world, 3, 2);
|
||||
}
|
||||
|
||||
super.onBlockPlacedBy(world, pos, state, player, stack);
|
||||
|
|
|
@ -280,4 +280,9 @@ public abstract class BlockContainerBase extends BlockContainer{
|
|||
protected PropertyInteger getMetaProperty(){
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType(){
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -85,19 +85,24 @@ public class ClientProxy implements IProxy{
|
|||
//VillagerRegistry.instance().registerVillagerSkin(ConfigIntValues.JAM_VILLAGER_ID.getValue(), new ResourceLocation(ModUtil.MOD_ID_LOWER, "textures/entity/villager/jamVillager.png"));
|
||||
|
||||
for(Object o : Util.ITEMS_AND_BLOCKS){
|
||||
ItemModelMesher mesher = Minecraft.getMinecraft().getRenderItem().getItemModelMesher();
|
||||
|
||||
ItemStack stack = null;
|
||||
if(o instanceof Item){
|
||||
List<ItemStack> subItems = new ArrayList<ItemStack>();
|
||||
((Item)o).getSubItems((Item)o, null, subItems);
|
||||
for(ItemStack aStack : subItems){
|
||||
mesher.register(aStack.getItem(), aStack.getItemDamage(), new ModelResourceLocation(ModUtil.MOD_ID_LOWER+":"+aStack.getItem().getRegistryName(), "inventory"));
|
||||
}
|
||||
stack = new ItemStack((Item)o);
|
||||
}
|
||||
else if(o instanceof Block){
|
||||
stack = new ItemStack((Block)o);
|
||||
}
|
||||
|
||||
if(stack != null){
|
||||
ItemModelMesher mesher = Minecraft.getMinecraft().getRenderItem().getItemModelMesher();
|
||||
String name = stack.getItem().getRegistryName();
|
||||
|
||||
List<ItemStack> subItems = new ArrayList<ItemStack>();
|
||||
((Block)o).getSubBlocks(Item.getItemFromBlock((Block)o), null, subItems);
|
||||
stack.getItem().getSubItems(stack.getItem(), null, subItems);
|
||||
|
||||
for(ItemStack aStack : subItems){
|
||||
mesher.register(aStack.getItem(), aStack.getItemDamage(), new ModelResourceLocation(ModUtil.MOD_ID_LOWER+":"+aStack.getItem().getRegistryName(), "inventory"));
|
||||
mesher.register(aStack.getItem(), aStack.getItemDamage(), new ModelResourceLocation(name, "inventory"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"parent": "builtin/generated",
|
||||
"textures": {
|
||||
"layer0": "actuallyadditions:items/itemBooklet"
|
||||
},
|
||||
"display": {
|
||||
"thirdperson": {
|
||||
"rotation": [ -90, 0, 0 ],
|
||||
"translation": [ 0, 1, -3 ],
|
||||
"scale": [ 0.55, 0.55, 0.55 ]
|
||||
},
|
||||
"firstperson": {
|
||||
"rotation": [ 0, -135, 25 ],
|
||||
"translation": [ 0, 4, 2 ],
|
||||
"scale": [ 1.7, 1.7, 1.7 ]
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue