Everything posted by Draco18s
-
Problems updating to 1.10
Your enums have this method: @Override public String getName() { return null; } You cannot return null here. Actually, that line is unhelpful. It's just a "new MyBlock()" line. The important bit is this bit:
-
Ok, what's Eclipse done now?
Thanks. I was darn sure that it cleared when I closed the search window, which is what I've done in the past (though I haven't even seen it highlight a whole bloody method, just the object name before).
-
[1.11] Updating Issues
What is the point of a private field with both methods to get the current value and modify the current value? That is, what is protected against that having the field public not protect against?
-
Making an item which is both stackable and damageable
A couple things: 1) any item stored in a chest (or other non-entityliving inventory) will not tick and thus not rot. 2) any item in an unloaded chunk (or in a player that is not connected to the server's inventory) will not tick and thus not rot. 3) how do you plan to handle combining a stack of "damage:1" meat with "damage:10" meat?
-
Ok, what's Eclipse done now?
What is this blue highlight and how do I get rid of it? It showed up when I did a search for existing usages of addPropertyOverride, opened up the ItemClock (it was faster than using the package explorer), and now it won't go away.
-
[1.10.2]AttachCapabilityEvent deprecated
It was deprecated in favor of: AttachCapabilitiesEvent<Entity>
-
[SOLVED] is there a way to get stack.stackSize in 1.11 ?
16.4 posts per day is not that many, especially for a moderator.
-
[1.8.9] onUsingTick never called
Unsurprisingly, -Xmx2G does too.
-
Creating a crafting handler the exports multiple items
@Override public int hashCode() { return item.hashCode(); } This won't work. ItemStack does not provide a hashcode implementation, therefor this wrapper class violates the hashcode/equals contract: That if equals returns true on two instances, hashcode must also return the same value. You will need to provide your own hash implementation. I suggest something along these lines: @Override public int hashCode() { return 37*item.getItem.hashCode() + item.getItemMetadata(); } Or use a HashUtility function: https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/hardlib/math/HashUtils.java Also, again:
-
[SOLVED] [1.10.2] Problem with saving items in my pan
What happens if there are no pancakes?
-
[1.10.2] How to trample crops when wearing certain armor
Which ticks even if you're not wearing the armor. Talk about overkill. (do your armor tick in one of your armor items, like the boots)
-
[1.11] Issues with Tab Icon Item
Huh?
-
[1.11] Updating Issues
On the other hand, it means (potentially) being able to toss item stacks of Air into the world, stacking them in your inventory, or pulling them out of the crafting grid. You'd have to do more work to prevent this, than I imagine you'd save by handling null correctly.
-
Creating a crafting handler the exports multiple items
The whole point of creating the wrapper was so you could do this: smeltmulti.get(stack);
-
[1.11] Updating Issues
That's super weird. Why would they change that?
-
(De)obfuscation / IClassTransformer / production environment
The question is "why?" Nearly everything anyone would want to do can be done without ASM, the rest should be submitted as a pull request to Forge.
-
(De)obfuscation / IClassTransformer / production environment
Coremods are heavily discouraged around here. Sooo....you are unlikely to get any help. That said: > a) what to do, to get the method names deobfuscated? > 1) asm patches are applied before deobfuscation You can't both of these. You're either waiting until after deobf, or you're not. You can't have both.
-
[SOLVED] [1.10.2] Problem with saving items in my pan
ItemStack newstack = stack.split(1);
-
[SOLVED] [1.10.2] Problem with saving items in my pan
You do know about stack splitting, yes?
-
Creating a crafting handler the exports multiple items
So you know how FurnaceRecpies has a method called getSmeltingResult? You need to do that for your own recipes.
-
[Solved] [1.10.2] Client-side tile entity not saving on quit
Its only still there for compatibility on things that haven't been updated to the new style yet. The method you're using takes in a metadata value, not a blockstate, thus is out of date.
-
Creating a crafting handler the exports multiple items
1) Does your ItemWrapper properly compare item stacks in equals and generate a hashcode? 2) Does your furnace try to pull a result from your hashmap?
-
[1.10.2] How to trample crops when wearing certain armor
I'd use the armor item's onArmorTick method. That way you're not having to check the player's inventory all the time, even when they're not wearing armor.
-
Creating a crafting handler the exports multiple items
Pretty much. e.g. List<OutputWrapper> list = new ArrayList<OutputWrapper>(); list.add(new OutputWrapper(1, Items.APPLE)); //apple because why not list.add(new OutputWrapper(0.2, Items.GOLD_NUGGET)); //arbitrary this.addSmeltingMulti(Items.BONE, list); That would mean that when you smelted a bone, you'd always get an apple and 20% of the time you'd get a gold nugget. You'd probably want to limit your secondaries to a maximum of your total output slots (e.g. if you have 3 output slots, have no more than 3 output items per input item). This is assuming that your random is based on floats. If you do integers, you may have to refactor to match your desired design goal (e.g. if you always roll rand.nextInt(100) then you pass in "20" as your 20%).
-
Creating a crafting handler the exports multiple items
You don't need the Tuple. You want something like this: private Map<ItemWrapper, List<OutputWrapper>> smeltmulti = new HashMap(); Then this: public class OutputWrapper{ public final float chance; public final ItemStack item; public OutputWrapper(float c, ItemStack i) { chance = c; item = i; } }
IPS spam blocked by CleanTalk.