-
Minecraft 1.10.2 Auto Repair Problem
I no longer need to. I found a fix for that problem but it still crashes because of the Capability. I dont know what i did wrong. I made a class where i used @CapabilityInject in and i put that in my preInit. The game only crashes when i get the Item in my inventory.
-
Minecraft 1.10.2 Auto Repair Problem
What should i update? The forge version or the mapping or what?
-
Minecraft 1.10.2 Auto Repair Problem
I am exactly in the same class and dont find this
-
Minecraft 1.10.2 Auto Repair Problem
package boyx.arandomstuff.handlers; import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.CapabilityInject; import net.minecraftforge.common.capabilities.ICapabilityProvider; import javax.annotation.Nonnull; import javax.annotation.Nullable; import boyx.arandomstuff.Reference; public class InternalTimers { @CapabilityInject(InternalTimers.class) public static final Capability<InternalTimers> CAPABILITY = null; public static final ResourceLocation NAME = new ResourceLocation(Reference.MODID, "internal_timers"); private final Timer repair = new Timer(); private final Timer heal = new Timer(); private final Timer feed = new Timer(); public void tick() { if (repair.shouldUpdate) { repair.tickCount++; repair.shouldUpdate = false; } if (heal.shouldUpdate) { heal.tickCount++; heal.shouldUpdate = false; } if (feed.shouldUpdate) { feed.tickCount++; feed.shouldUpdate = false; } } public void activateRepair() { repair.shouldUpdate = true; } public void activateHeal() { heal.shouldUpdate = true; } public void activateFeed() { feed.shouldUpdate = true; } public boolean canRepair() { if (repair.tickCount >= 19) { repair.tickCount = 0; repair.shouldUpdate = false; return true; } return false; } public boolean canHeal() { if (heal.tickCount >= 19) { heal.tickCount = 0; heal.shouldUpdate = false; return true; } return false; } public boolean canFeed() { if (feed.tickCount >= 19) { feed.tickCount = 0; feed.shouldUpdate = false; return true; } return false; } public static class Provider implements ICapabilityProvider { private final InternalTimers capInstance = new InternalTimers(); @Override public boolean hasCapability(@Nonnull Capability<?> capability, @Nullable EnumFacing facing) { return capability == CAPABILITY; } @Override public <T> T getCapability(@Nonnull Capability<T> capability, @Nullable EnumFacing facing) { if (capability == CAPABILITY) return CAPABILITY.cast(capInstance); else return null; } } private static class Timer { public int tickCount = 0; public boolean shouldUpdate = false; } } Thats the class i did the Capabilitys in. I dont know much and i didnt understand the documentation well.
-
Minecraft 1.10.2 Auto Repair Problem
In Minecraft the class ItemStack doesnt own a Method called isEmpty() somehow... I dont even know if this is the error. How i said some post above the crashlog says there too many ticks and something with the Capability doesnt work. [Edit] Btw the game crashes whenever i get the Repairer Item in my inventory.
-
Minecraft 1.10.2 Auto Repair Problem
It is undefined and not working in ItemStack...
-
Minecraft 1.10.2 Auto Repair Problem
Yes i tried that but it also doesnt work. I know many basic things in java. I also programmed some programs but not too complicated. I never did something like this advanced modding.
-
Minecraft 1.10.2 Auto Repair Problem
After i deleted the stack.isEmpty then yes it does
-
Minecraft 1.10.2 Auto Repair Problem
@CapabilityInject(InternalTimers.class) public static final Capability<InternalTimers> CAPABILITY = null; public static final ResourceLocation NAME = new ResourceLocation(Reference.MODID, "internal_timers"); I did this with the capability.
-
Minecraft 1.10.2 Auto Repair Problem
Minecraft Crash Report says this line is the error?
-
Minecraft 1.10.2 Auto Repair Problem
This is the crash report. Maybe it has nothing to do with the isEmpty error...
-
Minecraft 1.10.2 Auto Repair Problem
Do you know something i could use instead of this?
-
Minecraft 1.10.2 Auto Repair Problem
There are many things that can return a boolean but nothing i need i think. What i need is that it returns true if the ItemStack is empty for that i always used ItemStack.Empy or ItemStack.isEmpty and both dont work.
-
Minecraft 1.10.2 Auto Repair Problem
When i hover over it it says : isEmpty cannot be resolved or is not a field In the other mods ive just did the same thing. I created a new ItemStack stack = inv.getStackInSlot(i); and then just did invStack.isEmpty; to get a boolean.
-
Minecraft 1.10.2 Auto Repair Problem
Ok i expressed myself wrong. I know Java and i also know why its marked red but i dont understand why because i used this alot in some mods from me but only here it doesnt work. Thats what i ment by this
IPS spam blocked by CleanTalk.