Everything posted by Choonster
-
[1.7.10]Named Item
Then use ItemStack#getDisplayName . This will return the custom name if the stack has one, otherwise it will return the item's display name.
-
[1.7.10]Custom blockbounds
What are you actually trying to achieve? Block#setBlockBounds lets you set a block's bounds. Block#addCollisionBoxesToList lets you have multiple bounding boxes and/or change the bounds based on the colliding Entity .
-
[1.8] Trying to Create a Special Drop when Harvesting Leaves
Thanks diesieben07. I found all sorts of references that said event.block when I was doing my research. Here's two examples: http://www.minecraftforge.net/wiki/Event_Reference http://www.minecraftforge.net/forum/index.php?topic=19820.0 But I appreciate your assistance in getting me a quick and accurate response. Those are for 1.7.10 and earlier. 1.8 introduced the blockstate system (i.e. IBlockState ), which largely replaced the old block metadata system (though technically the new system is still just a wrapper around the metadata).
-
[1.7.10]Named Item
Use ItemStack#hasDisplayName .
-
[SOLVED] [1.8][1.7.10] Custom tool harvesting some blocks slowly
I found the source of the problem: not all blocks have a harvest tool/level set, so you need to override Item#canHarvestBlock and Item#getDigSpeed to check the block's Material like the vanilla tools do. You can see my new code here: 1.7.10, 1.8
-
[1.8] Mod is not recognized as a mod
Yes it is. My resources are in src/main/resources Your build.gradle is telling Gradle to look in $projectDir/src/java and $projectDir/src/resources instead of the default src/main/java and src/main/resources. You should delete the sourceSets block entirely, it's not needed if you use the default locations.
-
[1.8] Mod is not recognized as a mod
Unfortunately there are no obvious errors in the log. Are you sure your @Mod class is present in the JAR?
-
[1.8] Mod is not recognized as a mod
Then post a log from when it doesn't load (i.e. from a client with the mod in its mods folder). The debugging suggestion was a separate recommendation to the log posting.
-
Unresponsive @ Phase 3
Headcrumbs is trying to use a global entity ID that's already being used by something else. Report this to the author.
-
[1.8] ¿Entities what happend to entityes when setDead();
Each tick, World#updateEntities updates any loaded entities that aren't dead and removes any dead entities from the loaded entity list. Once there are no more references to the Entity , it should simply be garbage collected.
-
[1.8] Mod is not recognized as a mod
It looks like your mod loads without issue in that log.
-
[1.8] How to Create a Custom Liquid?
Post the full error and the full class.
-
[1.8] How to Create a Custom Liquid?
I don't know what you are talking about [nobbc][/nobbc] Jokes aside: Either check "Don't use smileys" in "Attachments and other options" or disable BBCode temporarily by surrounding the desired passage with [nobbc][nobbc][/nobbc][/nobbc] (the creation of this involved that tag ). Thanks, I wasn't aware of that option.
-
[1.8] How to Create a Custom Liquid?
BlockFluidNoFlow is my own fluid block class, it's just a fluid that doesn't flow outwards. BlockFluidClassic and BlockFluidFinite are the fluid block classes provided by Forge. The doc comment on each class briefly explains what it does. ModFluids.createFluid creates and registers the Fluid instance (a singleton like Block and Item ) using the specified fluid name and texture name. The Fluid instance defines the physical properties of the fluid like luminosity, density and viscosity (explained in doc comments of the corresponding Fluid fields). ModFluids.registerFluidBlock receives the fluid's Block instance as an argument, sets its unlocalised name to the fluid's unlocalised name and registers it. The Block instance represents the fluid when it's in the world and actually implements the in-world behaviour corresponding to the Fluid 's properties (e.g. light level is controlled by the luminosity, flow speed is controlled by the viscosity). My code doesn't handle the Fluid already being registered by another mod. If a Fluid with the same name as yours (e.g. steam ) is already registered, you should use that Fluid instance and its Block instead of creating your own. I know BuildCraft has an example of this (for 1.7.10, but it should be the same in 1.. Edit: I wish 8 followed by a ) didn't turn into a smiley.
-
[1.8] How to Create a Custom Liquid?
Yes, that's what my ModFluids class does. You can do model registration in the same class as the fluid creation/registration, but I prefer to register all models in a separate client-only class ( ModModelManager ). A Fluid can be either a liquid or a gas. Liquids behave like Water/Lava, gases are just liquids that flow upwards instead of downwards.
-
This crash AGAIN AND AGAIN!
Industrial Craft 2 failed to extract its copy of the EJML library properly. If you're using a modpack, report this to the modpack authors. Otherwise, try updating to the latest official build of IC2.
-
[1.8] Mod is not recognized as a mod
It looks like you've posted the output from the console, but the log file should have some more information about the mod loading process in it. Could you post that? Use Gist if it's too large for Pastebin. You should also try building a deobfuscated copy of your mod (run the jar Gradle task), adding that as a mod in a separate ForgeGradle project, putting some breakpoints in JarDiscoverer#discover and stepping through it to see what's going wrong.
-
[SOLVED] [1.8][1.7.10] Custom tool harvesting some blocks slowly
In 1.8, Item#getStrVsBlock is only used in Item#getDigSpeed (which ItemTool overrides to use tool classes) and InventoryPlayer#getStrVsBlock (which isn't used anywhere). In 1.7.10, Item#func_150893_a (the equivalent method) is only used in EntityPlayer#isCurrentToolAdventureModeExempt (which should use my override of Item#canHarvestBlock first) and Inventory#func_146023_a (which again isn't used anywhere).
-
[1.8] How to Create a Custom Liquid?
Adding the Fluid and its Block aren't that different in 1.8, except you need to pass ResourceLocation s of the fluid's textures to the Fluid constructor. The new model system is fairly different, though. You need to use Forge's advanced blockstates format to tell each fluid block to use Forge's fluid model and specify which Fluid to use the textures from. I don't have a guide, but I do have examples: Fluid / Block instantiation and registration: my mod, Forge Model registration: my mod, Forge Blockstates file: my mod, Forge The registration of fluid containers (buckets and tanks) in my ModFluids class is currently broken ( FluidContainerRegistry doesn't support NBT-based fluid containers), so don't use that. Edit: Fixed the formatting.
-
[SOLVED] [1.8][1.7.10] Custom tool harvesting some blocks slowly
I've created a tool that can function as a pickaxe, axe or shovel; but for some reason it's harvesting specific blocks much slower than the effective vanilla tool does while harvesting other blocks at the same speed as the vanilla tool. The slow blocks include Block of Coal, Dispenser, Note Block, Bricks, Obsidian, Redstone Ore, Monster Spawner, Stairs, Doors and Pressure Plates. I can't see any pattern in which blocks are slow and which are normal speed. My code can be found here: 1.7.10, 1.8. Does anyone know what's going wrong? Is there some vanilla method I need to implement?
-
Strange problems with vectors
If you're going to use multiple values from a string split, you should store returned array in a local variable and reference that instead of calling String#split once per value. Doing this will also allow you to step through the code in a debugger and see what the values for each position are before they're parsed into floats.
-
[1.7.10] Cofh RedstoneFlux API
BuildCraft and EnderIO both have examples of RF generators and pipes.
-
[1.7.10] Custom skills, looking for advice
You'll probably want to use IExtendedEntityProperties to store the stats for each player. coolAlis has a tutorial on the system here. To implement the effects of these stats, just use the hooks and events provided by Forge. How you do this depends on what you actually want to do.
-
Custom spawning in one area?
Witches are spawned in Witch Huts in the ComponentScatteredFeaturePieces.SwampHut#addComponentParts method.
-
[1.7.10] Help with status effects and items!
If using the Ibuprofen is instant, override Item#onItemRightClick to apply the damage or potion effect. If you need to eat it like a potion, override the following methods (look at ItemFood and ItemPotion to see examples of this): Item#getMaxItemUseDuration to return 32 (the same use duration as food and potions) Item#getItemUseAction to return EnumAction.drink (the same action as potions) or EnumAction.eat (the same action as food) Item#onItemRightClick to call EntityPlayer#setItemInUse with the ItemStack argument and the result of calling this.getMaxItemUseDuration with the ItemStack argument (this makes the player start using the item when they right click) Item#onEaten to apply the damage or potion effect To check if a player has a potion effect active, use EntityLivingBase#isPotionActive ( EntityPlayer extends from EntityLivingBase ). To apply a potion effect, use EntityLivingBase#addPotionEffect . To damage a player, use Entity#attackEntityFrom .
IPS spam blocked by CleanTalk.