Everything posted by Choonster
-
Block Transform doesnt work.
I just re-read your post and noticed that you're using a block. Item display transformations are only applied when the model is rendered for an item, they're not applied when the model is rendered for a block in the world. I think you can specify a base TRSRTransformation for a model using Forge's blockstates format. Set the "transform" key of a variant to an object with either a single "matrix" key or some combination of "translation", "rotation", "scale" and/or "post-rotation" keys. You can see a simple example here in RFTools and a slightly more complex example here in a Forge test mod. Look at ForgeBlockStateV1.TRSRDeserializer to see how Forge deserialises TRSRTransformations.
-
Block Transform doesnt work.
If you look at the model format, you'll see that your display section is incorrect. You need to specify the display transformations for a specific transform type (e.g. thirdperson_righthand, ground).
-
Mod Rejection FML
The game directory is C:\Users\owner\AppData\Roaming\.minecraft, but you've installed mods in C:\Users\owner\Desktop\.minecraft\mods so Forge isn't loading them. Either install mods in C:\Users\owner\AppData\Roaming\.minecraft\mods or change the game directory to C:\Users\owner\Desktop\.minecraft.
-
[1.12] Adding recipes to recipe book upon gaining item
That's exactly what vanilla does and what you need to do. They don't need to visible (i.e. you don't need to specify the "display" element in the advancements), they just need to exist.
-
Can't change player speed
Override Item#getAttributeModifiers to call the super method, add a movement speed AttributeModifier to the returned Multimap and then return the Multimap. The modifiers in the returned Multimap will automatically be applied to any entity that equips or holds the item. The key of the Multimap is the attribute's name (IAttribute#getName).
-
Add and Remove Advancements
WorldServer#getAdvancementManager returns the server world's AdvancementManager. The World#advancementManager field is never used by client worlds, I'm not entirely sure why it's in World rather than WorldServer. Looking into this further, advancements are actually stored in the AdvancementList instance (AdvancementManager.ADVANCEMENT_LIST and ClientAdvancementManager#advancementList). You'll need to use reflection to access the server instance and the internal collections.
-
1.12 How did you create you recipes
If a recipe fails to load, there will be an error in the log explaining why.
-
[1.12] Make custom potion not display potion particles
You can use the PotionEffect(Potion potionIn, int durationIn, int amplifierIn, boolean ambientIn, boolean showParticlesIn) constructor to control whether or not particles are displayed for a PotionEffect.
-
1.12 How did you create you recipes
Forge automatically loads every recipe file in the assets/<modid>/recipes directory, you don't need to manually register them.
-
1.12 What is the use of this ResourceLocation Parameter in EntityRegistry.registerModEntity?
RealmOfTheDragons#onPostInit is never called because it has more than one parameter, there should be a warning in the log telling you this. This means that CommonProxy#onPostInit is never called and your entity is never registered. Proxies are for sided code, common code belongs in your @Mod class (or classes called from it). I recommend using an interface rather than a class as the common type of your proxies (i.e. the type of the @SidedProxy field).
-
1.12 What is the use of this ResourceLocation Parameter in EntityRegistry.registerModEntity?
Where do you register your entity?
-
EnumFacing problem
That would work, but EnumFacing.getFront uses the same indexes as EnumFacing.VALUES (because it uses EnumFacing.VALUES), i.e. EnumFacing#getIndex rather than Enum#ordinal. There's also no need to use any index here, you already have the EnumFacing returned by EnumFacing#getOpposite.
-
[1.12.1]How would one spawn a custom mob with custom armor and a custom weapon?
I explained that in my first reply. I've also just edited it to include a detail that I forgot (EntityLiving#setEquipmentBasedOnDifficulty needs to be called from EntityLiving#onInitialSpawn).
-
[1.12.1]How would one spawn a custom mob with custom armor and a custom weapon?
Why are you using EntityJoinWorldEvent for your own entity? Look at the constructors of the ItemStack class to what parameters they require. You should have your Item and Block instances stored in static fields of a class (usually called something like ModItems/ModBlocks), you can get the instances from these fields to pass to the ItemStack constructor. Do you actually know Java? You need to have a solid understanding of both Java and OO programming in general to a make a mod. This forum isn't for helping people with basic Java issues. Do you ever spawn an EntityMasterJacket?
-
[1.12.1]How would one spawn a custom mob with custom armor and a custom weapon?
Use Entity#setItemStackToSlot to set the item in an entity's equipment slot. If the mob should always spawn with this equipment or always has a chance to spawn with it, override EntityLiving#setEquipmentBasedOnDifficulty to set the equipment and then override EntityLiving#onInitialSpawn to call it. If the equipment is specific to the way it's being spawned, set the equipment manually before spawning it. Edit: Forgot to mention that EntityLiving#setEquipmentBasedOnDifficulty needs to be called from EntityLiving#onInitialSpawn.
-
EnumFacing problem
EnumFacing#getOpposite already returns an EnumFacing, you're getting its ordinal and then looking it up in the EnumFacing.VALUES array to get the same EnumFacing. You don't need to use the EnumFacing.VALUES array here at all. The indexes of EnumFacing.VALUES are the ones returned by EnumFacing#getIndex, not the ones returned by Enum#ordinal. These happen to be the same, but it's more correct to use the same indexes that are used to populate the array. Use EnumFacing.getFront to get an EnumFacing by its index rather than using the EnumFacing.VALUES array directly.
-
EnumFacing problem
Use EnumFacing#getOpposite to get the opposite facing. Use the EnumFacing.values method or the EnumFacing.VALUES array to get all EnumFacing values.
-
Add and Remove Advancements
Forge will load advancements from your mod's assets/<modid>/advancements directory. I don't think there's any way to remove vanilla advancements without messing around with the internals of AdvancementManager.
-
[1.12] ItemRecord Sound to InputStream
The name of a SoundEvent isn't the name of the sound file(s) it plays, you need to get the file the same way that the sound system does. First use SoundHandler#getAccessor to get the SoundEventAccessor for the SoundEvent's name (SoundEvent#getSoundName). This is a wrapper around zero or more ISoundEventAccessor objects, each of which could be either another SoundEventAccessor (a sound event) or a Sound (a sound file). Then use SoundEventAccessor#cloneEntry to select a random Sound from the event's list of sound files and Sound#getSoundAsOggLocation to get the path to the sound file (a ResourceLocation). One you have the path, use IResourceManager#getResource to get the IResource and IResource#getInputStream to get the InputStream. If the record has more than one possible file, this will select one at random. To get every possible file, you'd need to access SoundEventAccessor#accessorList via reflection.
-
Where did the FMLMissingMappingsEvent go?
It was replaced by RegistryEvent.MissingMappings<T extends IForgeRegistryEntry<T>> in the 1.12 registry overhaul. T is the registry type you want to handle the missing mappings for.
-
[1.12] Porting old mod
Looking at the methods where C08PacketPlayerBlockPlacement was used (PlayerControllerMP#onPlayerRightClick and PlayerControllerMP#sendUseItem), it's been replaced by CPacketPlayerTryUseItemOnBlock (sent by PlayerControllerMP#processRightClickBlock when the player right clicks a block) and CPacketPlayerTryUseItem (sent by PlayerControllerMP#processRightClick when the player right clicks air). What are you actually trying to do?
-
[1.11.2] One piece armor.
I created an armour item that replaces your other armour when equipped and restores it when unequipped here. I created an armour item that deletes itself as soon as it's unequipped here. I use these two classes here and here to create an armour set that's automatically equipped when you equip the helmet.
-
[1.10.2] Issues when dropping mod items from blocks.
Blocks should be created and registered before Items. Apart from that, I can't see any obvious problems. What makes you think something is wrong? I highly recommend migrating to registry events, they allow you to register things at the right time without worrying about when that is. This will also make it easier to update to 1.12+, where GameRegistry.register is private. I recommend against having a common proxy; proxies are for sided code, common code belongs in your @Mod class (or classes called from it). I recommend using an interface as the common parent of your proxy classes rather than a common proxy class.
-
[1.10.2] Issues when dropping mod items from blocks.
Blocks are created and registered before Items, so you can't pass an Item to a Block constructor. When you create your Block instance, your Item fields haven't been initialised yet; so they still contain null.
-
Don't decomp. Forge 1.11
Hard drive space is irrelevant, RAM is what you don't have enough of.
IPS spam blocked by CleanTalk.