Images of the issue:
The top and side of this item is a bit weird, it looks like not all of the pixels are rendering in 3D. The code should be fine but here it is:
public static void init(){
enchanted_gem = new ItemBasic().setUnlocalizedName("enchanted_gem");
enchanted_dust = new ItemEnchantedDust().setUnlocalizedName("enchanted_dust");
}
public static void register(){
GameRegistry.registerItem(enchanted_gem, "enchanted_gem");
GameRegistry.registerItem(enchanted_dust, "enchanted_dust");
}
public static void registerRenders(){
registerRender(enchanted_gem);
registerRender(enchanted_dust);
}
public static void registerRender(Item item){
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Reference.MOD_ID + ":" + item.getUnlocalizedName().substring(5), "inventory"));
}
The item in the pics is the enchanted_gem, while enchanted_dust works perfectly fine.
So I'm trying to use the PlayerSleepInBedEvent but I want all of my code to execute somewhat while the player is in the middle of sleeping not as soon as the player right-clicks the bed. Is there a way to do this? Before I started using this event I used a PlayerTickEvent and just used the sleepTimer from the player of when to activate the event but I feel that the tick event may cause lag if it's always checking the if statement. Please correct me if I'm wrong but any help is appreciated
Alright so I have these achievements here:
if(player.inventory.hasItem(Item.getItemFromBlock(WinterBlocks.icedStone))){
player.addStat(WinterAch.icedStone, 1);
}
if(player.inventory.hasItem(WinterItems.iceCrystal)){
player.addStat(WinterAch.iceCrystal, 1);
}
if(player.inventory.hasItem(WinterItems.iceIngot)){
player.addStat(WinterAch.iceIngot, 1);
}
So basically I have these all in a PlayerTickEvent which can lead onto some lag. At least logically. So I was wondering if there was a different place I could put these items with the same effect. These items are crafted in a custom furnace so using the pickup or crafting events won't be useful here.
So Im trying to get an item array pick out a random item drop. But I've been testing and all I get is null. The metaList works because I get back 4 but for some reason my itemList only returns null.
Here is the code for better understanding:
public Item[] itemList = {WinterItems.crystalSword,WinterItems.refIcePickaxe,WinterItems.candyCaneAxe,WinterItems.commonItem};
public int[] metaList = {0,0,0,4};
public Item itemDropped;
public int metaDropped;
public BlockChristmasPresent(Material par2Material) {
super(par2Material);
this.itemDropped = itemList[3];
this.metaDropped = metaList[3];
}
public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) {
par1World.playSoundAtEntity(par6EntityPlayer, "wintercraft:rip", 1F, 1F);
System.out.println(itemList[0]);
System.out.println(metaDropped);
}
Thanks for any help!
For some reason Optifine is conflicting with my mod and whenever I go to use a custom music disk it just doesn't play but the text will show up. Any ideas?