Everything posted by brandon3055
-
[1.7.10] Messing with stack sizes
Because part of the way minecraft checks if an item is enchantable is wit this method public boolean isItemTool(ItemStack p_77616_1_) { return this.getItemStackLimit(p_77616_1_) == 1 && this.isDamageable(); } to fix your problem you need to override isItemTool in your item class and return true.
-
Sending Data to Server through DataWatchers
iff you are sending packets to the server for control and thats where you need the entity in your message handler you can get the plater that sent the packet using. messageContext.getServerHandler().playerEntity
-
Sending Data to Server through DataWatchers
why cant you just use player.ridingEntity to get the entity the player is riding?
-
[1.7.2][Solved] Can still fly when gravity chestplate is off
Oh i see its in the wrong spot it should be here if (playersWithFlight.get(player) && !player.worldObj.isRemote) { //<--- playersWithFlight.put(player, false); if (!player.capabilities.isCreativeMode) { player.capabilities.allowFlying = false; player.capabilities.isFlying = false; player.sendPlayerAbilities(); } } But if its working for you it probably dosnt matter.
-
[1.7.2][Solved] Can still fly when gravity chestplate is off
Your most welcome! Infact i think you should remove the isRemote altogether
-
[1.7.2][Solved] Can still fly when gravity chestplate is off
OOOh change if (event.phase != TickEvent.Phase.START || event.player.worldObj.isRemote) return; to if (event.phase != TickEvent.Phase.START || !event.player.worldObj.isRemote) return; and that should do the trick. Edit infact remove the isRemote altogether if (event.phase != TickEvent.Phase.START) return;
-
[1.7.2][Solved] Can still fly when gravity chestplate is off
Ok it worked as we planned When it was on: Equipment Stack 1xitem.GravityChestplate@0 Item com.skullcrusher.BetterThings.Armor.GravityArmor@4aa33ead Target Item com.skullcrusher.BetterThings.Armor.GravityArmor@4aa33ead true When it was off: Equipment Stack null Target Item com.skullcrusher.BetterThings.Armor.GravityArmor@4aa33ead false did you copy just the changes or the entire class?
-
[1.7.2][Solved] Can still fly when gravity chestplate is off
Hmmm.... try putting printlns in both sides of the main if statement (the one that sets weather or not the player can fly) and see which one is called
-
[1.7.2][Solved] Can still fly when gravity chestplate is off
It has nothing todo with the item class... i assume yoy checked if you can fly now?
-
[1.7.2][Solved] Can still fly when gravity chestplate is off
i think i see the problem can you please show me your moditems class (where you have you instance of GravityChestplate) Edit:wait... i dont see the problem... that should work
-
[1.7.2][Solved] Can still fly when gravity chestplate is off
Ok thats a bit of a mess... Try this i think i fixed the null pointer and may have figured out why it isnt working.
-
[1.7.2][Solved] Can still fly when gravity chestplate is off
Oops another typo it should be event.player.getEquipmentInSlot(3) Didnt it give you an error on that line?
-
Drop set not working
"Raze_carbondrop" is not an item it is your ModItem class try Raze_carbondrop.CDrop
-
[1.7.2][Solved] Can still fly when gravity chestplate is off
oops remove .getItem() from the first System.out so System.out.println("Equipment Stack "+getEquipmentInSlot(3)); if (event.player.getEquipmentInSlot(3) != null) System.out.println("Item "+event.player.getEquipmentInSlot(3).getItem()); System.out.println("Target Item"+BetterThings.GravityChestplate); if (event.player.getEquipmentInSlot(3) != null && event.player.getEquipmentInSlot(3).getItem() == BetterThings.GravityChestplate) and make sure you are wearing the chestplate it crashed because it tried to get the item from the stack in your chestplate slot but that stack was null.
-
Drop set not working
In future try to give more detail in your first post then just "Its not working. Help me fix it"
-
Drop set not working
I think toy need to actually create an item class that extends Item. What you have done there may be possible but i have never seen it done before. And you still havent clarified the problem do you mean the block dosnt drop that item when you break it?
-
onItemLeftClick() onItemMiddleClick() methods exist ?
I dont believe the method you are looking for exists. You may have to just use an event handler.
-
[1.7.2][Solved] Can still fly when gravity chestplate is off
There are two ways of registering event handlers the MinecraftForge event is the 2nd way FMLCommonHandler.instance().bus().register(new ClassName()) is another way. Thats kinda correct. There are multiple different event busses MinecraftForge.EVENT_BUS and FMLCommonHandler.instance().bus() are just 2 of therm and they each handle different events so you need to register your event to the correct buss which in this case is FMLCommonHandler.instance().bus() And he isnt working on the client side. @OP Well you are closer atleast try adding System.out.println("Equipment Stack "+getEquipmentInSlot(3).getItem()); if (event.player.getEquipmentInSlot(3) != null) System.out.println("Item "+event.player.getEquipmentInSlot(3).getItem()); System.out.println("Target Item"+BetterThings.GravityChestplate); if (event.player.getEquipmentInSlot(3) != null && event.player.getEquipmentInSlot(3).getItem() == BetterThings.GravityChestplate) bellow if (event.phase != TickEvent.Phase.START || event.player.worldObj.isRemote) return; and tell me what is printed to the console.
-
(SLOVED)[1.7.10]Hiding item from NEI
Just to clarify what The_Fireplace said (which is 100% correct) nei scans all mods loaded for a class named NEI[some name]Config and calls the "loadConfig()" method within it. For this to work you need to add nei to your workspace as a library.
-
[1.7.2][Solved] Can still fly when gravity chestplate is off
Message Deleted (Wrong thread)
-
[1.7.10] Change vanilla recipe output
I may be wrong but it dosnt look like there is... atleast no easy way your best bet is probably to just replace it.
-
[1.7.2][Solved] Can still fly when gravity chestplate is off
The armor class dosnt need to know anything. It is the ArmorEventHandler that detects if the players is wearing the chestplate and sets weather or not they can fly.
-
[1.7.2][Solved] Can still fly when gravity chestplate is off
That is where the @SubscribeEvent public void onEntityUpdate(PlayerTickEvent event) method is supposed to be...
-
Entity moving after setting motion to zero
I just checked some code i used to ass velocity to an entity and i used entity.addVelocity(d2 / d4 * 8.0D, 5.20000000298023224D, d3 / d4 * 8.0D); entity.velocityChanged = true; so maby try entity.setVelocity(0D, 0D, 0D); entity.velocityChanged = true; Edit: i just threw that into my LivingUpdateEvent handler and it froze every entity in the world so if it dosnt work you you it must be as you said "the block's update loop is being called before the entity"
-
[1.7.10] Get Player's Capabilities In OnUpdate & Key Handling With Packets
Correct think of isRemote as isClient.
IPS spam blocked by CleanTalk.