Everything posted by ItsAMysteriousYT
-
[Solved] [1.8] onBlockPlacedBy and onBlockPlaced Not Working
OnBlockPlacedBy doesn't work for me either - i try setting rotation of a tileentity with it. Probably this is a forge bug?
-
Bind textures that are not in the resources folder?
Is there a way to bind a texture to a 3dmodel without using a resourcelocation?
-
[1.8] Light
Am i able to create moving lights with that?
-
Best way to store a player into IEEP?[1.8]
Ah - okay, thanks
-
Best way to store a player into IEEP?[1.8]
Im searching for a way to store a player in another players IEEP and the player should still be in there when the other player changes his name. What variable of EntityPlayer do i have to use for that?
-
[1.8][SOLVED] TileEntity is missing a mapping!
No, don't do that - render classes can only be registered on the CLIENT, whereas TileEntities themselves need to be registered on both sides (i.e. 'common' code). You are just asking to crash your mod when you play it multiplayer by writing code like that - rendering registrations should all be in the ClientProxy. EDIT: I reread your post and see that snippet IS in your ClientProxy, in which case are you also registering the TileEntities on the server? Because the server will need to know about them, too, and it won't if they only get registered in the ClientProxy. No actually they don't - thanks for that
-
Creating a batteryitem with energyvalue?
Nono, its okay, just was wondering about where i had to update it Thanks!
-
Creating a batteryitem with energyvalue?
For the updating procedure, do i just call onUpdate in my TileEntity then or do i have to make that out of the itemStack somehow so it does not forcecrash the game?
-
Creating a batteryitem with energyvalue?
So i just have to get the value change it and saveit back all in the NBT? Okay, strange that minecraft hasn't got a better way yet.
-
Creating a batteryitem with energyvalue?
Oh - true, i tried that once, where else should i store it? IEEP would make sense here i think.
-
Creating a batteryitem with energyvalue?
Better? @Override public void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected) { super.onUpdate(stack, worldIn, entityIn, itemSlot, isSelected); if(!stack.hasTagCompound()){ NBTTagCompound batteryTag = new NBTTagCompound(); batteryTag.setFloat("Voltage", voltage); stack.writeToNBT(batteryTag); }else { NBTTagCompound batteryTag = stack.getTagCompound(); batteryTag.setFloat("Voltage", voltage); stack.writeToNBT(batteryTag); } }
-
Creating a batteryitem with energyvalue?
Okay - ill add a check then if the stack holds a tag already.
-
[1.7.10] NBT on item inventory not reading/writing
Im sorry - struggeling with this atm too. Here is a tutorial that should help: http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/1571597-forge-1-6-4-1-8-custom-inventories-in-items-and
-
Creating a batteryitem with energyvalue?
Okay - im doing this right now - is this right? package itsamysterious.mods.reallifemod.core.items; import net.minecraft.entity.Entity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import net.minecraftforge.fml.common.registry.GameRegistry; public class ItemBattery extends Item{ private float voltage; public ItemBattery() { this.voltage=100; setUnlocalizedName("itemBattery"); GameRegistry.registerItem(this, getUnlocalizedName().substring(5)); } @Override public void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected) { super.onUpdate(stack, worldIn, entityIn, itemSlot, isSelected); NBTTagCompound batteryTag = new NBTTagCompound(); batteryTag.setFloat("Voltage", voltage); stack.writeToNBT(batteryTag); } public boolean updateItemStackNBT(NBTTagCompound nbt) { NBTTagCompound batteryTag = nbt.getCompoundTag("BatteryTag"); this.voltage=batteryTag.getFloat("Voltage"); return true; } }
-
[1.7.10] NBT on item inventory not reading/writing
Oh - than this is the problem. Make the IInventory thing in your ItemClass i would say.
-
[1.7.10] problem with event handling (I think)
Yea - i would do that, also - if you don't wanna pay for your server, triangle is a good service, but atm they are in beta and the free servers do not work. Link is http://www.triangle.gs
-
[1.7.10] NBT on item inventory not reading/writing
You need to do super.readFromNBT(combound) and super.writeToNBT(combound)
-
[1.8][SOLVED] TileEntity is missing a mapping!
You can keep it, but its not necessary, just have a method in your clientproxy in which you register all your tileentities. If you wanna make it a bit more easy and don't wanna have all that GameRegistry.registerTileEntity stuff for each of your tiles-use this generic method: private void setupTile(Class<? extends TileEntity> class1, TileEntitySpecialRenderer render) { try { ClientRegistry.bindTileEntitySpecialRenderer(class1, render.getClass().newInstance()); } catch (Exception e) { e.printStackTrace(); } GameRegistry.registerTileEntity(class1, class1.getName()); } It takes in the TileEntity and the relatet renderer
-
Creating a batteryitem with energyvalue?
I wanna creat a batteryitem that gets empty after a while when in use(equipped in a specific TileEntity OR Item). How can i save the current energyvalue and where do i have to update it? There is a method called onUpdate i think - anything i have to do special in there e.g only update server/clientSide any packethandling stuff or just changing the energyvalue?
-
[UNSOLVED]Strange things happen with my energysystem[1.8]
Probably yes, 4.2k views. I think many people wanna make an energysystem here
-
[UNSOLVED]Strange things happen with my energysystem[1.8]
Yea, my problem is i do not know how to acces the coordinates in the packet or do i have to send them to some static variables?
-
[UNSOLVED]Strange things happen with my energysystem[1.8]
But it seems to be working perfectly fine.And my packet still won't work.
-
[UNSOLVED]Strange things happen with my energysystem[1.8]
Okay - the energysystem is working pretty well now, just two thing - first: The blocks do not immediatly update their lighting value(e.g. lanterns) Second: The rotation still does not work in onBlockPlacedBy: My code is @Override public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { super.onBlockPlacedBy(worldIn, pos, state, placer, stack); TileEntity tileentity = worldIn.getTileEntity(pos); if (tileentity instanceof TileEntity_Electric){ TileEntity_Electric tile = (TileEntity_Electric)tileentity; tile.rotation = MathHelper.floor_double((double)(placer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; System.out.println("Succesfully rotated "+tile.getClass().getName()); } } Perhaps it is necessary to say that im extending my own CustomBlock class and not the default BlockClass for the electrisity blocks?
-
[UNSOLVED]Strange things happen with my energysystem[1.8]
A well okay - now. I found a way doing it with a clientOnly method and render it on the tileentity - see: @SideOnly(Side.CLIENT) public float clientVoltage; //Update method if(worldObj.isRemote) { this.clientVoltage=getVoltage(); } SO, that thing is fixed now - thanks
-
How to use Reflection to change vanilla values
Why not? Whats so bad about it?
IPS spam blocked by CleanTalk.