fix dice
This commit is contained in:
parent
20633332c8
commit
dc85ecc293
31 changed files with 39 additions and 92 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue