Everything posted by Choonster
-
[1.10.2] Getting Player Entity from Capability for Update Message
Store the player in a field of the Money class.
-
Player enters area
I don't think there's any other way than checking every tick, but doing it per-player may be less expensive than using World#getEntitiesWithinAABB.
-
Player enters area
One alternative would be subscribing to PlayerTickEvent and checking if the player is in the region before teleporting them back. This probably has fairly minimal overhead, but you should profile it to check.
- [1.11.2] Rendering 2D texture in 3D
-
Ticking Entity (Common Issue)
"Ticking entity" is just a generic message used for any crash report that happens when an entity is being ticked. It doesn't say anything about what caused the crash report. If your code is crashing, post the crash report (or read it yourself and figure out why it's happening).
-
[1.10.2] Saving Energy in a tile entity
Call Capability#getStorage on the IEnergyStorage Capability instance to get its IStorage instance, then call IStorage#writeNBT and IStorage#readNBT to write an IEnergyStorage to/read it from NBT. You can get the Capability instance from the CapabilityEnergy.ENERGY field or create your own static field and annotate it with @CapabilityInject(IEnergyStorage.class).
-
[1.10.2] Saving Energy in a tile entity
Because IStorage is an unrelated interface for reading capabilities from and writing them to NBT. Use Capability#getStorage to get the IStorage of a Capability.
-
Minecraft Models
The first search result for "System editor can only open file base resources" was this thread, where diesieben07 explains how to fix this.
-
[1.10.2] Saving Energy in a tile entity
The IStorage for the IEnergyStorage capability simply saves the stored energy as an NBTTagInt. Either use the IStorage or do the same thing yourself. You can still use IContainerListener#sendProgressBarUpdate and Container#updateProgressBar to synchronise numeric data like stored energy and progress, you just can't use IContainerListener#sendAllWindowProperties. Alternatively, you can use your own packets.
-
[1.10.2] Block specific id's...?
Use World Capabilities or World Saved Data, either per-map or per-dimension as needed. You can see how RFTools stores its telerporter destinations here.
-
Getting Items within Any Crafting Area
Don't. If you solved your problem, post the solution so other people can find it when they have a similar problem.
-
[1.11.2] Fast TESR not rendering
I think you're translating to the wrong position. AnimationTESR sets the translation to the coordinate arguments minus the TileEntity's coordinates, you're setting the translation to the TileEntity's coordinates.
-
Getting Items within Any Crafting Area
Use a custom IRecipe implementation.
-
[1.11.2] Make item stay in crafting and decrease durability
Create your own copy of the ItemStack#damageItem method without the creative mode check.
-
[1.11.2] Make item stay in crafting and decrease durability
You mentioned an ore recipe, but you didn't mention that the ingredient was an ore dictionary entry. In that case, you need to use OreDictionary.WILDCARD_VALUE when adding your item to the ore dictionary.
-
[1.11.2] Make item stay in crafting and decrease durability
You're probably using 0 as the ingredient's metadata when adding the recipe, so only metadata 0 is accepted. Use OreDictionary.WILDCARD_VALUE to accept any metadata value.
-
[1.11.2] Make item stay in crafting and decrease durability
That's not what Draco told you to do. You damage the ItemStack, but then you return the result of the super method (a completely separate ItemStack). The original ItemStack that you damaged is ignored. You need to return the ItemStack that you damaged.
-
[1.10] Removing all natural mob spawns
You can cancel WorldEvent.PotentialSpawns to prevent any entities from being spawned passively, but structures spawn their entities directly and don't fire any events apart from EntityJoinWorldEvent. PopulateChunkEvent.Pre is fired before a chunk is populated (i.e. before most structures are generated) and PopulateChunkEvent.Post is fired after a chunk has been populated (i.e. after most structures are generated), so you can use these to set a per-chunk boolean value and use this in conjunction with EntityJoinWorldEvent to prevent any entities from being spawned during structure generation. Unfortunately mod world generators all run after PopulateChunkEvent.Post, as do structures generated in IChunkGenerator#generateStructures rather than IChunkGenerator#populate. The only vanilla structure to do this is the Ocean Monument. You could suggest that entities spawned by structures fire a unique event (either on the forums or on GitHub), but there's no guarantee that it will be accepted (and very little chance it will be added to 1.10.2).
-
[1.11] Setting/Getting a String List or String Array
The ID of the tag type that the list will contain. Use the values from the Constants.NBT class.
-
Get hand drop chance
EntityLiving#inventoryHandsDropChances and EntityLiving#inventoryArmorDropChances store the drop chances for the entity's held items and armour respectively. These fields are both protected, so you'll need to use reflection to access them.
-
[1.8.9] OkHttp crushing the client?
You're also using the wrong annotation for your ClientConnectedToServerEvent handler: @Mod.EventHandler is only for FML lifecycle events (classes that extend net.minecraftforge.fml.common.event.FMLEvent) and only works in your @Mod class. @SubscribeEvent is for gameplay events (classes that extend net.minecraftforge.fml.common.eventhandler.Event) and only works in a class that's had the Class object or an instance registered with the appropriate EventBus.
-
[UNSOLVED][1.10.2]Need help with TESR and tileentity item
Post your code.
-
[UNSOLVED][1.10.2]Need help with TESR and tileentity item
The TileEntity shouldn't know or care about that, the TileEntitySpecialRenderer should initialise its stored TileEntity instance with any data required to render it in the inventory.
-
[1.8.9] OkHttp crushing the client?
The Minecraft class implements the IThreadListener interface, so you can use an instance of it as an IThreadListener.
-
[1.11] IPerspectiveAwareModel vs IBakedModel
You probably should implement it so that your model isn't rendered at a weird scale or rotation in GUIs, on entities, etc. If you're wrapping an existing model that implements IPerspectiveAwareModel, you can likely delegate to that.
IPS spam blocked by CleanTalk.