naturaGodhead
-
Posts
63 -
Joined
-
Last visited
Posts posted by naturaGodhead
-
-
1 hour ago, jabelar said:
Sorry you're right, but I got confused because you register your class to the bus in pre-init and most people have switched to the @EventBusHandler annotation instead so admit I just assumed you did it all the old way.
Like I said, maybe subscribe to the other events, including maybe the terrain gen bus, related to world generation and chunk population and print out console statements to see if your biome is ever actually used. Also possibly in your ashBlock in the getDefaultState() method maybe put a console statement to see how much activity it is getting in terms of being placed. Or if that generates too much console spam, set a breakpoint on getDefaultState() for your block (you might have to @Override and just call the super-method in order to breakpoint within your custom block.)
I've tried setting up a listener and changing some things around, and it seems like the biome is never actually being registered at all. Any idea why? I would've thought the registry.register would do that...
-
15 minutes ago, jabelar said:
How do you know it is not working? It is actually a bit tough to know if your biome is working without wandering around a lot in the world, but you should at least be able to tell that your biome is registered and you could do things like handling the world gen or chunk load events and test what biome is present.
Also note that in 1.12.x you should technically register your biomes by subscribing to the RegistryEvent<Biome> instead. See information on that here: https://mcforge.readthedocs.io/en/latest/concepts/registries/ However I think that for now at least that registering in pre-init should still work.
My biome handler class subscribes to the registryevent. I'm not completely sure that it isn't working, but turning the weight up and exploring for hours hasn't shown anything.
-
So I'm having a go at biomes just for kicks, but I get stuck at getting it to actually show up in the world. Feels like I'm missing something and everything I can find online is old information from previous versions.
Biome Handler:
Biome:
CommonProxy: (Relevant bit)
public void preInit(FMLPreInitializationEvent e) { MinecraftForge.EVENT_BUS.register(new RosetteBiomes()); }
-
Nevermind, it evidently was just the old data. I loaded up a new world and the block functions correctly.
-
3 minutes ago, Draco18s said:
No, you're wrong.
Did your inventory previously only have 1 slot? Are you reloading a world with a TE that had been previously saved?
It did at one point. I made a new world when I started trying to figure it out though. Passing 0 as the index for each one makes the slots work fine, but I can't reference them with onSlotChanged that way.
-
When I label all of the slots as index 0 it works just fine.
-
15 minutes ago, Dustpuppy said:
private ItemStackHandler inventory = new ItemStackHandler(4);
Is wrong.
private ItemStackHandler inventory = new ItemStackHandler[4];
Would be better, i think.
That doesn't work. ItemStackHandler accepts an int value as a size parameter. It's not an array.
-
When opening my gui, it pauses for about 2 seconds, then crashes.
Container class:
Tile entity class:
Crash:
java.lang.RuntimeException: Slot 1 not in valid range - [0,1)
at net.minecraftforge.items.ItemStackHandler.validateSlotIndex(ItemStackHandler.java:210)
at net.minecraftforge.items.ItemStackHandler.getStackInSlot(ItemStackHandler.java:75)
at net.minecraftforge.items.SlotItemHandler.getStack(SlotItemHandler.java:79) -
I've been able to get the metadata working just fine, but I haven't been able to figure out what I need to do to make the sub blocks render in the inventory. I feel like there has to be a simple solution. They just show the missing texture, but don't show the missing model text, so I assume they're trying to use the main block's model as a parent.
Blockstate JSON
https://github.com/linkisheroic/rosetteMod/tree/master/main/resources/assets/rosette/models/block
Block Models
Block in question.
-
So I'm more or less just trying to track how metadata properties get set with a basic flower with color meta. When I place in the world, I only get the color=white variety, no matter what the color was when I had it in my inventory. What's up? I'm just not really understanding something I think.
I know naming conventions/etc are probably not the best way. I'm genuinely attempting to learn what I'm doing. I've noticed that the replies on here tend to lean on the "learn java" side.
-
I've been working on a beehive block, and I've been using the furnace metadata to attempt to get the rotation for the block working correctly. For some reason even though everything looks the same as the vanila furnace, when I load up the game the entire block is just a pink + black missing texture. What am I doing wrong?
Code:
package com.natura.artifacts.block; import java.util.Random; import com.natura.artifacts.Main; import com.natura.artifacts.item.ArtifactItems; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntityFurnace; import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.world.World; public class BeeHive extends Block { private Item drop; private int meta; private int least_quantity; private int most_quantity; @SideOnly(Side.CLIENT) public IIcon iconFront; @SideOnly(Side.CLIENT) public IIcon blockIcon; @SideOnly(Side.CLIENT) public IIcon iconBottom; protected BeeHive(Material material, Item drop, int least, int most) { super(material); this.setBlockName("beeHive"); this.setCreativeTab(ArtifactItems.tabArtifacts); this.setHardness(0.6F); this.setResistance(0.2F); this.setHarvestLevel("axe", 2); this.setStepSound(soundTypeWood); this.setBlockTextureName(Main.MODID + ":beeHiveSide"); this.drop = drop; this.least_quantity = least; this.most_quantity = most; } public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) { int l = MathHelper.floor_double((double)(p_149689_5_.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; if (l == 0) { p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, 2, 2); } if (l == 1) { p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, 5, 2); } if (l == 2) { p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, 3, 2); } if (l == 3) { p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, 4, 2); } } @SideOnly(Side.CLIENT) @Override public IIcon getIcon(int side, int meta) { return side == 1 ? this.iconBottom : (side == 0 ? this.iconBottom : (side != meta ? this.blockIcon : this.iconFront)); } @SideOnly(Side.CLIENT) @Override public void registerBlockIcons(IIconRegister reg) { this.blockIcon = reg.registerIcon("beeHiveSide"); this.iconBottom = reg.registerIcon("beeHiveBottom"); this.iconFront = reg.registerIcon("beeHiveFront"); } @Override public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { if(!p_149727_1_.isRemote) { if(p_149727_5_.getCurrentEquippedItem() != null) { if(p_149727_5_.getCurrentEquippedItem().getItem() == Items.bucket) { p_149727_5_.inventory.consumeInventoryItem(Items.bucket); p_149727_5_.inventory.addItemStackToInventory(new ItemStack(ArtifactItems.honeyBucket, 1, 0)); p_149727_5_.inventoryContainer.detectAndSendChanges(); return true; } } } return true; } @Override public Item getItemDropped(int meta, Random random, int fortune) { return this.drop; } @Override public int quantityDropped(int meta, int fortune, Random random) { if (this.least_quantity >= this.most_quantity) return this.least_quantity; return this.least_quantity + random.nextInt(this.most_quantity - this.least_quantity + fortune + 1); } }
NoSuchField Error when using a mod as an API?
in Modder Support
Posted · Edited by naturaGodhead
So I'm working on an addon mod for a smaller mod. I've got the environment working fine, and I can reference classes from the main mod. Once I try to run it, the game crashes with the following error:
https://pastebin.com/D00kSPug
The error is coming from the main mod itself, which I don't really understand. I've talked to the devs of the mod and the most they can offer me is that there's an obfuscation problem somewhere.
Here's my code:
https://github.com/linkisheroic/minestuckarsenal