Everything posted by Draco18s
-
Muliple blocks using the same blockstate ?
Warning: StateMapperBase is marked @SideOnly(Client). You cannot operate with it in common code.
-
Block that holds only one item.
if(jar.itemStored == null) { //do something } ?
-
Block that holds only one item.
jar.itemStored = heldItem.getItem(); //make the stored item the held item if(jar.itemStored == heldItem.getItem()) { //now check if they're the same (of course they are!)
-
Using / Implementing API?
There's a few things you might be looking for. There's the @Optional annotation, which removes methods/fields/classes/interfaces if the mod isn't present There's also the Loader.isModLoaded(...) method which checks to see if the mod is available.
-
Teleporting a Player Every Second.
Or...New Random().nextInt(10) - 5 (not that "New Random().nextInt(...)" will actually compile)
-
[SOLVED] [1.8] Help with registering client command
You didn't override getRequiredPermissionLevel, so odds are the value returned by it is not what you want.
-
[SOLVED] [1.11] Shapeless and Shaped Recipes Issues, crashing game
So, none of this relates to your problem, but they're more general "you haven't broken it yet, but it could in the future" sort of things. 1) I would make all of the static FoodBase fields static Item fields. There's no reason to keep them more specific. 2) This: if (item instanceof ItemModelProvider) { ((FoodBase)item).registerItemModel(item); } Don't case to FoodBase, you didn't check to see if the item was FoodBase, you checked to see if it was ItemModelProvider. Cast to that. Yes, you can still invoke registerItemModel, as the interface has that method declared. 3) Not sure why you pass the item back to it, and then not use it though (instead you use this which would be the same object, so...why?) 4) Why did you define the setCreativeTab method? Isn't one already supplied by the Item class? Why did you change the return type? Why do you call this post-constructor, when you call setRegistryName and setUnlocalizedName in the constructor (which also return this )? 5) Don't use protected String name; the only place you use it is for the item model, which you should be using .getRegistryName() for anyway Anyway, I can't see what's wrong. Looks like something might going sour inside ShapelessRecipes#getRemainingItems that isn't your fault.
-
[SOLVED] [1.11] Shapeless and Shaped Recipes Issues, crashing game
I did not need the ItemStack class, I will however need your ModItems class.
-
[SOLVED] [1.11] Shapeless and Shaped Recipes Issues, crashing game
Post your main class
-
Creating a crafting handler the exports multiple items
You need to refactor things so that your "firstvalidoutputslot" variable isn't based on checking "is it this one? is it this one? is it this one?" You need to write a function to do that, rather than encapsulating it inside the smelt method.
-
Creating a crafting handler the exports multiple items
Then what is this loop for? for (int inputSlot = FIRST_INPUT_SLOT; inputSlot < FIRST_INPUT_SLOT + INPUT_SLOTS_COUNT; inputSlot++) {...}
-
[1.10] Custom Hanging Entity Issues
Oh, you put "or" and I read it as "and." Thanks diesieben07.
-
[1.10.2] Custom Crop Planting Crash
I haven't messed with them yet myself. Here's how Lex does it: https://github.com/LexManos/VoidUtils/blob/master/src/main/java/net/minecraftforge/lex/voidutils/VoidUtils.java#L96-L120 But the point remains:
-
Need a ASM tutorial.
Even if you think you need one, you likely don't, and even then if you do, don't. ASM is a dark abyss that looks back into your soul.
-
[1.10.2] Custom Crop Planting Crash
Gosh. What ever could the problem be? Given that I've seen people (try to) pass the item to their block, and the block to their item...I'm not so sure. You can't do that. Your crop class must reference ModItems.seed directly, it cannot take it as a parameter to its constructor.
-
[1.10.2] Custom Crop Planting Crash
You register your items before your blocks, so you pass null to your item's constructor. There's literally 4000 posts on this forum about this issue.
-
Creating a crafting handler the exports multiple items
Sorry, that's too dense for me to figure out what your intentions are. I assumed you had a 1-input, multi-output furnace. It looks like you actually have multi-(1-input:1-output) furnace. The idea I had in my head was that you had one input, you would get its list of outputs, and iterate over that list, checking to see if the probabilistic result item was outputted or not.
-
Adding fish to rod 1.10
No, you subscribe to the LootTableLoadEvent, and when the gameplay.fishing.fish loot table is loaded, you get it's loot table and call addItemToTable(...) passing the appropriate arguments. e.g.: https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/farming/FarmingEventHandler.java#L428
-
Container disappears when created by item.
The note there is basically saying "BlockContainer does a bunch of bad things, either don't use it, or override the things it changes to change them back." You should just make your Crate extend Block.
-
[1.10] transferstackinslot! Help!!
That would be correct. Packets are easy. https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/industry/network/CtoSMessage.java https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/industry/network/PacketHandlerServer.java
-
Creating a crafting handler the exports multiple items
public List<OutputWrapper> getMultiResult(ItemStack stack) { return multismeltList.get(stack); } You don't need to iterate over the entry set.
-
Best or Correct way to add to a dead entities Drops
Each bit sounds pretty straight forward. If I knew more I could probably encode it into a loot table modification. (the tricky bit is writing your own loot conditions) Or at least, enough to be able to copy/paste and modify a few values for the other items.
-
[1.10] Custom Hanging Entity Issues
I wondered about that with the BlockPos, I hadn't seen anywhere a good way to encode it in packets (and vanilla decomposes it, or at least does for SPacketSpawnObject packet; see line 58). Also, good to know about the read/write enum values. Much handy. Makes things @Override public void writeSpawnData(ByteBuf buffer) { PacketBuffer pack = new PacketBuffer(buffer); pack.writeBlockPos(getHangingPosition()); pack.writeEnumValue(this.getHorizontalFacing()); } @Override public void readSpawnData(ByteBuf buffer) { PacketBuffer pack = new PacketBuffer(buffer); hangingPosition = pack.readBlockPos(); updateFacingWithBoundingBox(pack.readEnumValue(EnumFacing.class)); }
-
Creating a crafting handler the exports multiple items
Arbitrary prime number. Its the number I have in my HashUtils class. It's probably not the best number, but there is no "perfect" hash formula, I just needed one that was "good enough." The return object from .get(...) will be that Output wrapper you wrote. You should absolutely return that to your furnace. Because it needs to decide what to do with the two values it contains.
-
[1.10] Custom Hanging Entity Issues
As there are very few posts about IEntityAdditionalSpawnData... (Not that it was hard, but having the reference is nice!) Make the custom entity implement it and then write this: @Override public void writeSpawnData(ByteBuf buffer) { BlockPos p = getHangingPosition(); buffer.writeInt(p.getX()); buffer.writeInt(p.getY()); buffer.writeInt(p.getZ()); buffer.writeInt(this.getHorizontalFacing().getIndex()); } @Override public void readSpawnData(ByteBuf buffer) { BlockPos p = new BlockPos(buffer.readInt(),buffer.readInt(),buffer.readInt()); this.hangingPosition = p; int f = buffer.readInt(); updateFacingWithBoundingBox(EnumFacing.values()[f]); }
IPS spam blocked by CleanTalk.