diff --git a/client/src/main/java/client/renderer/blockmodel/ModelBakery.java b/client/src/main/java/client/renderer/blockmodel/ModelBakery.java index 9d326241..776d4803 100755 --- a/client/src/main/java/client/renderer/blockmodel/ModelBakery.java +++ b/client/src/main/java/client/renderer/blockmodel/ModelBakery.java @@ -214,9 +214,6 @@ public abstract class ModelBakery } private static final ModelBlock getModel(Item item, ModelProvider provider, String name) { - ModelBlock model = (ModelBlock)item.getCustomModel(provider, name); - if(model != null) - return new ModelBlock(model, item.getCustomPosition()); if(item.hasBuiltinModel()) return new ModelBlock(MODEL_ENTITY, GuiPosition.NORMAL); Block block = item.getBlock(); diff --git a/client/src/main/java/client/renderer/entity/RenderDie.java b/client/src/main/java/client/renderer/entity/RenderDie.java index 976325af..7829a254 100755 --- a/client/src/main/java/client/renderer/entity/RenderDie.java +++ b/client/src/main/java/client/renderer/entity/RenderDie.java @@ -2,44 +2,33 @@ package client.renderer.entity; import org.lwjgl.opengl.GL11; -import client.Client; +import client.renderer.GlState; import client.renderer.model.ModelDie; -import client.renderer.texture.TextureMap; import common.entity.projectile.EntityDie; +import common.item.projectile.ItemDie; -public class RenderDie extends Render -{ - private final ModelDie model = new ModelDie(); +public class RenderDie extends Render { + private final ModelDie model = new ModelDie(); - public RenderDie(RenderManager renderManagerIn) - { - super(renderManagerIn); -// this.shadowSize = 0.09F; - } - - protected String getEntityTexture(EntityDie entity) - { - return TextureMap.BLOCKS; - } - - public void doRender(EntityDie entity, double x, double y, double z, float partialTicks) - { -// BlockRendererDispatcher blockrendererdispatcher = Game.getClient().getBlockRendererDispatcher(); - GL11.glPushMatrix(); - GL11.glTranslatef((float)x, (float)y + 0.05F, (float)z); - this.bindEntityTexture(entity); - if(entity.getValue() == 0) + public RenderDie(RenderManager renderManagerIn) { + super(renderManagerIn); + } + + protected String getEntityTexture(EntityDie entity) { + return "textures/object/die_d" + ((ItemDie)entity.getItem()).getSides() + ".png"; + } + + public void doRender(EntityDie entity, double x, double y, double z, float partialTicks) { + GL11.glPushMatrix(); + GL11.glTranslatef((float)x, (float)y + 0.05F, (float)z); + this.bindEntityTexture(entity); + if(entity.getValue() == 0) GL11.glRotatef((float)((entity.ticksExisted % 10) * (360 / 10)), 0.3f, 0.4f, 0.1f); -// GlState.translate(-0.05F, -0.05F, 0.05F); - GL11.glScalef(0.5f, 0.5f, 0.5f); - Client.CLIENT.getRenderItem().renderItemAsGround(entity.getStack()); -// blockrendererdispatcher.renderBlockBrightness(Blocks.planks.getDefaultState(), entity.getBrightness(partialTicks)); - GL11.glPopMatrix(); - super.doRender(entity, x, y, z, partialTicks); - } - -// protected boolean canRenderName(EntityDie entity) -// { -// return entity.getValue() != 0 || super.canRenderName(entity); -// } + GL11.glScalef(-0.1f, -0.1f, 0.1f); + GlState.disableCull(); + this.model.render(entity, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); + GlState.enableCull(); + GL11.glPopMatrix(); + super.doRender(entity, x, y, z, partialTicks); + } } diff --git a/client/src/main/java/client/renderer/model/ModelDie.java b/client/src/main/java/client/renderer/model/ModelDie.java index 0f990928..3a8a5669 100755 --- a/client/src/main/java/client/renderer/model/ModelDie.java +++ b/client/src/main/java/client/renderer/model/ModelDie.java @@ -1,27 +1,16 @@ package client.renderer.model; -import org.lwjgl.opengl.GL11; - import common.entity.Entity; -public class ModelDie extends ModelBase -{ - ModelRenderer cube; +public class ModelDie extends ModelBase { + ModelRenderer cube; - public ModelDie() - { - this.cube = new ModelRenderer(this, 0, 0); - this.cube.addBox(-8.0F, -8.0F, -8.0F, 16, 16, 16); -// this.cube.rotationPointY += (float)(24 - 16); - } - - public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) - { - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, 0.6F, 0.0F); - if(Math.abs(entityIn.motionX) > 0.05 || Math.abs(entityIn.motionY) > 0.05 || Math.abs(entityIn.motionZ) > 0.05) - GL11.glRotatef((float)((entityIn.ticksExisted % 20) * (360 / 20)), 0.3f, 0.4f, 0.1f); - this.cube.render(scale); - GL11.glPopMatrix(); - } + public ModelDie() { + this.cube = new ModelRenderer(this, 0, 0); + this.cube.addBox(-8.0F, -8.0F, -8.0F, 16, 16, 16); + } + + public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) { + this.cube.render(scale); + } } diff --git a/client/src/main/resources/textures/items/die_10.png b/client/src/main/resources/textures/items/die_10.png new file mode 100755 index 00000000..97e031b5 Binary files /dev/null and b/client/src/main/resources/textures/items/die_10.png differ diff --git a/client/src/main/resources/textures/items/die_12.png b/client/src/main/resources/textures/items/die_12.png new file mode 100755 index 00000000..7ca5797b Binary files /dev/null and b/client/src/main/resources/textures/items/die_12.png differ diff --git a/client/src/main/resources/textures/items/die_20.png b/client/src/main/resources/textures/items/die_20.png new file mode 100755 index 00000000..046b50b4 Binary files /dev/null and b/client/src/main/resources/textures/items/die_20.png differ diff --git a/client/src/main/resources/textures/items/die_4.png b/client/src/main/resources/textures/items/die_4.png new file mode 100755 index 00000000..d249e9b7 Binary files /dev/null and b/client/src/main/resources/textures/items/die_4.png differ diff --git a/client/src/main/resources/textures/items/die_6.png b/client/src/main/resources/textures/items/die_6.png new file mode 100755 index 00000000..5bf962d8 Binary files /dev/null and b/client/src/main/resources/textures/items/die_6.png differ diff --git a/client/src/main/resources/textures/items/die_8.png b/client/src/main/resources/textures/items/die_8.png new file mode 100755 index 00000000..2741deb5 Binary files /dev/null and b/client/src/main/resources/textures/items/die_8.png differ diff --git a/client/src/main/resources/textures/items/die_d10_side.png b/client/src/main/resources/textures/items/die_d10_side.png deleted file mode 100755 index c928f915..00000000 Binary files a/client/src/main/resources/textures/items/die_d10_side.png and /dev/null differ diff --git a/client/src/main/resources/textures/items/die_d10_top.png b/client/src/main/resources/textures/items/die_d10_top.png deleted file mode 100755 index 531447a2..00000000 Binary files a/client/src/main/resources/textures/items/die_d10_top.png and /dev/null differ diff --git a/client/src/main/resources/textures/items/die_d12_side.png b/client/src/main/resources/textures/items/die_d12_side.png deleted file mode 100755 index 4ff1b07e..00000000 Binary files a/client/src/main/resources/textures/items/die_d12_side.png and /dev/null differ diff --git a/client/src/main/resources/textures/items/die_d12_top.png b/client/src/main/resources/textures/items/die_d12_top.png deleted file mode 100755 index d9ef5874..00000000 Binary files a/client/src/main/resources/textures/items/die_d12_top.png and /dev/null differ diff --git a/client/src/main/resources/textures/items/die_d20_side.png b/client/src/main/resources/textures/items/die_d20_side.png deleted file mode 100755 index 596b72bb..00000000 Binary files a/client/src/main/resources/textures/items/die_d20_side.png and /dev/null differ diff --git a/client/src/main/resources/textures/items/die_d20_top.png b/client/src/main/resources/textures/items/die_d20_top.png deleted file mode 100755 index ed89d744..00000000 Binary files a/client/src/main/resources/textures/items/die_d20_top.png and /dev/null differ diff --git a/client/src/main/resources/textures/items/die_d4_side.png b/client/src/main/resources/textures/items/die_d4_side.png deleted file mode 100755 index d7cb196b..00000000 Binary files a/client/src/main/resources/textures/items/die_d4_side.png and /dev/null differ diff --git a/client/src/main/resources/textures/items/die_d4_top.png b/client/src/main/resources/textures/items/die_d4_top.png deleted file mode 100755 index d023ba48..00000000 Binary files a/client/src/main/resources/textures/items/die_d4_top.png and /dev/null differ diff --git a/client/src/main/resources/textures/items/die_d6_side.png b/client/src/main/resources/textures/items/die_d6_side.png deleted file mode 100755 index 50d4deb4..00000000 Binary files a/client/src/main/resources/textures/items/die_d6_side.png and /dev/null differ diff --git a/client/src/main/resources/textures/items/die_d6_top.png b/client/src/main/resources/textures/items/die_d6_top.png deleted file mode 100755 index 14f29e82..00000000 Binary files a/client/src/main/resources/textures/items/die_d6_top.png and /dev/null differ diff --git a/client/src/main/resources/textures/items/die_d8_side.png b/client/src/main/resources/textures/items/die_d8_side.png deleted file mode 100755 index 787620d3..00000000 Binary files a/client/src/main/resources/textures/items/die_d8_side.png and /dev/null differ diff --git a/client/src/main/resources/textures/items/die_d8_top.png b/client/src/main/resources/textures/items/die_d8_top.png deleted file mode 100755 index e48306a6..00000000 Binary files a/client/src/main/resources/textures/items/die_d8_top.png and /dev/null differ diff --git a/client/src/main/resources/textures/object/die_d10.png b/client/src/main/resources/textures/object/die_d10.png new file mode 100644 index 00000000..6e6cc79b Binary files /dev/null and b/client/src/main/resources/textures/object/die_d10.png differ diff --git a/client/src/main/resources/textures/object/die_d12.png b/client/src/main/resources/textures/object/die_d12.png new file mode 100644 index 00000000..426b87da Binary files /dev/null and b/client/src/main/resources/textures/object/die_d12.png differ diff --git a/client/src/main/resources/textures/object/die_d20.png b/client/src/main/resources/textures/object/die_d20.png new file mode 100644 index 00000000..0902ab9d Binary files /dev/null and b/client/src/main/resources/textures/object/die_d20.png differ diff --git a/client/src/main/resources/textures/object/die_d4.png b/client/src/main/resources/textures/object/die_d4.png new file mode 100644 index 00000000..c851fc0e Binary files /dev/null and b/client/src/main/resources/textures/object/die_d4.png differ diff --git a/client/src/main/resources/textures/object/die_d6.png b/client/src/main/resources/textures/object/die_d6.png new file mode 100644 index 00000000..2aa3786c Binary files /dev/null and b/client/src/main/resources/textures/object/die_d6.png differ diff --git a/client/src/main/resources/textures/object/die_d8.png b/client/src/main/resources/textures/object/die_d8.png new file mode 100644 index 00000000..6ec9e556 Binary files /dev/null and b/client/src/main/resources/textures/object/die_d8.png differ diff --git a/common/src/main/java/common/entity/projectile/EntityDie.java b/common/src/main/java/common/entity/projectile/EntityDie.java index 255e240d..32135b7c 100755 --- a/common/src/main/java/common/entity/projectile/EntityDie.java +++ b/common/src/main/java/common/entity/projectile/EntityDie.java @@ -6,6 +6,7 @@ import common.entity.types.EntityLiving; import common.entity.types.EntityThrowable; import common.entity.types.IObjectData; import common.init.SoundEvent; +import common.item.Item; import common.item.ItemStack; import common.item.projectile.ItemDie; import common.tags.TagObject; @@ -115,8 +116,8 @@ public class EntityDie extends EntityThrowable implements IObjectData return this.getValue() != 0; } - public ItemStack getStack() { - return new ItemStack(ItemDie.getBySides(this.sides)); + public Item getItem() { + return ItemDie.getBySides(this.sides); } public boolean interactFirst(EntityNPC player) @@ -125,7 +126,7 @@ public class EntityDie extends EntityThrowable implements IObjectData { if(this.noPickup) this.setDead(); - else if(player.addItemStackToInventory(this.getStack())) { + else if(player.addItemStackToInventory(new ItemStack(this.getItem()))) { this.setDead(); player.worldObj.playSoundAtEntity(player, SoundEvent.POP, 0.2F); player.inventoryContainer.detectAndSendChanges(); @@ -140,7 +141,7 @@ public class EntityDie extends EntityThrowable implements IObjectData // return false; if(!this.worldObj.client && !this.dead) { if(!this.noPickup) - this.entityDropItem(this.getStack(), 0.0f); + this.entityDropItem(new ItemStack(this.getItem()), 0.0f); this.setDead(); } return true; diff --git a/common/src/main/java/common/item/Item.java b/common/src/main/java/common/item/Item.java index 22bb3e7c..332cd1b4 100755 --- a/common/src/main/java/common/item/Item.java +++ b/common/src/main/java/common/item/Item.java @@ -10,9 +10,6 @@ import common.entity.npc.Attribute; import common.entity.npc.EntityNPC; import common.entity.types.EntityLiving; import common.entity.types.IProjectile; -import common.model.Model; -import common.model.Model.ModelProvider; -import common.model.GuiPosition; import common.tileentity.TileEntity; import common.util.BlockPos; import common.util.Clientside; @@ -351,16 +348,6 @@ public class Item { return new String[] {name}; } - @Clientside - public Model getCustomModel(ModelProvider provider, String name) { - return null; - } - - @Clientside - public GuiPosition getCustomPosition() { - return null; - } - @Clientside public String[] getSprites() { return null; diff --git a/common/src/main/java/common/item/projectile/ItemDie.java b/common/src/main/java/common/item/projectile/ItemDie.java index 73118aff..a68091e1 100755 --- a/common/src/main/java/common/item/projectile/ItemDie.java +++ b/common/src/main/java/common/item/projectile/ItemDie.java @@ -10,12 +10,8 @@ import common.init.SoundEvent; import common.item.CheatTab; import common.item.Item; import common.item.ItemStack; -import common.model.Model; -import common.model.Model.ModelProvider; -import common.model.GuiPosition; import common.tileentity.TileEntity; import common.util.BlockPos; -import common.util.Clientside; import common.util.Facing; import common.util.Pair; import common.util.Serverside; @@ -82,17 +78,6 @@ public class ItemDie extends Item // playerIn.triggerAchievement(StatRegistry.objectUseStats[ItemRegistry.getIdFromItem(this)]); return itemStackIn; } - - @Clientside - public Model getCustomModel(ModelProvider provider, String name) { - return provider.getModel("items/die_d" + this.sides + "_side").add(4.8f, 4.8f, 4.8f, 11.2f, 11.2f, 11.2f).nswe().uv(0, 0, 16, 16) - .du("items/die_d" + this.sides + "_top").uv(0, 0, 16, 16); - } - - @Clientside - public GuiPosition getCustomPosition() { - return GuiPosition.DICE; - } @Serverside public ItemStack dispenseStack(AWorldServer world, TileEntity source, Vec3 position, BlockPos blockpos, Facing facing, ItemStack stack) { diff --git a/common/src/main/java/common/model/GuiPosition.java b/common/src/main/java/common/model/GuiPosition.java index 7a048677..01bf6d92 100755 --- a/common/src/main/java/common/model/GuiPosition.java +++ b/common/src/main/java/common/model/GuiPosition.java @@ -5,7 +5,6 @@ import common.util.Clientside; @Clientside public enum GuiPosition { NORMAL(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f), - DICE(135.0f, -55.0f, 180.0f, 0.0f, 0.0f, 0.0f, 2.75f), STAIRS(0.0f, 180.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f), SMALL(0.0f, 0.0f, 0.0f, 0.0f, 0.25f, 0.0f, 1.25f), SMALL_FLAT(0.0f, 0.0f, 0.0f, 0.0f, 1.5f, 0.0f, 1.25f),