mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Disable repair cost increment on rename
Effectively a backport of a 1.8 feature. Relevant because otherwise a renamed crate is nbt-incompatible with itself after being placed and broken
This commit is contained in:
parent
4bc07d9cbf
commit
6fb0b647fd
@ -107,6 +107,7 @@ import net.minecraftforge.event.entity.item.ItemTossEvent;
|
|||||||
import net.minecraftforge.event.entity.living.*;
|
import net.minecraftforge.event.entity.living.*;
|
||||||
import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent;
|
import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent;
|
||||||
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
|
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
|
||||||
|
import net.minecraftforge.event.entity.player.AnvilRepairEvent;
|
||||||
import net.minecraftforge.event.entity.player.AttackEntityEvent;
|
import net.minecraftforge.event.entity.player.AttackEntityEvent;
|
||||||
import net.minecraftforge.event.entity.player.PlayerFlyableFallEvent;
|
import net.minecraftforge.event.entity.player.PlayerFlyableFallEvent;
|
||||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||||
@ -1248,6 +1249,15 @@ public class ModEventHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onAnvilRepair(AnvilRepairEvent event) {
|
||||||
|
|
||||||
|
// Anvil renaming no longer increments the repair cost
|
||||||
|
if(event.left != null && event.right == null && event.output != null) {
|
||||||
|
event.output.setRepairCost(event.left.getRepairCost());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onClickSign(PlayerInteractEvent event) {
|
public void onClickSign(PlayerInteractEvent event) {
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user