generated from makamys/forge-mod-template
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,4 +18,8 @@ jar { | |
|
||
} | ||
|
||
jar.manifest.attributes ( | ||
'FMLAT': "${project.modid}_at.cfg", | ||
) | ||
|
||
apply from: "makalibs.gradle" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/main/java/makamys/coretweaks/bugfix/DoubleEatFixer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package makamys.coretweaks.bugfix; | ||
|
||
import cpw.mods.fml.common.eventhandler.SubscribeEvent; | ||
import cpw.mods.fml.common.gameevent.TickEvent; | ||
import cpw.mods.fml.common.gameevent.TickEvent.Phase; | ||
import net.minecraft.item.ItemStack; | ||
|
||
public class DoubleEatFixer { | ||
|
||
/* | ||
* Using the second suggested fix in this comment (don't reset itemInUse if the items are the "same"): https://bugs.mojang.com/browse/MC-86252?focusedCommentId=298278&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-298278 | ||
* We don't ignore item damage though. Not that it matters for food. | ||
*/ | ||
@SubscribeEvent | ||
public void onClientTick(TickEvent.PlayerTickEvent event) { | ||
if(event.phase == Phase.START) { | ||
if(event.player.itemInUse != null) { | ||
ItemStack currentItem = event.player.inventory.getCurrentItem(); | ||
if(event.player.itemInUse != currentItem && ItemStack.areItemStacksEqual(currentItem, event.player.itemInUse)) { | ||
event.player.itemInUse = currentItem; | ||
} | ||
} | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
public net.minecraft.entity.player.EntityPlayer field_71074_e #itemInUse |