-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FTB Utils Integration + Effortless Building Improvements
FTB: - Fixes Ghost Items - Sends a nice status message on cancel Effortless: - Fixes Dupe Bugs - Fixes Able to Place in FTB Claimed Chunks - Make Configs Editable on the Fly
- Loading branch information
1 parent
47c24ed
commit 57e1b08
Showing
31 changed files
with
1,001 additions
and
50 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
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
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
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
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
37 changes: 37 additions & 0 deletions
37
...main/java/com/nomiceu/nomilabs/integration/effortlessbuilding/EffortlessEventHandler.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,37 @@ | ||
package com.nomiceu.nomilabs.integration.effortlessbuilding; | ||
|
||
import net.minecraft.entity.player.EntityPlayerMP; | ||
import net.minecraft.item.ItemBlock; | ||
import net.minecraftforge.event.entity.player.PlayerInteractEvent; | ||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; | ||
|
||
import nl.requios.effortlessbuilding.EffortlessBuilding; | ||
import nl.requios.effortlessbuilding.buildmode.BuildModes; | ||
import nl.requios.effortlessbuilding.buildmode.ModeSettingsManager; | ||
import nl.requios.effortlessbuilding.buildmodifier.ModifierSettingsManager; | ||
import nl.requios.effortlessbuilding.network.RequestLookAtMessage; | ||
|
||
@SuppressWarnings("unused") | ||
public class EffortlessEventHandler { | ||
|
||
@SubscribeEvent | ||
public static void onPlayerInteract(PlayerInteractEvent.RightClickBlock event) { | ||
var player = event.getEntityPlayer(); | ||
var stack = player.getHeldItem(event.getHand()); | ||
if (!(stack.getItem() instanceof ItemBlock itemBlock)) return; | ||
|
||
BuildModes.BuildModeEnum buildMode = ModeSettingsManager.getModeSettings(player).getBuildMode(); | ||
ModifierSettingsManager.ModifierSettings modifierSettings = ModifierSettingsManager.getModifierSettings(player); | ||
|
||
if (buildMode != BuildModes.BuildModeEnum.NORMAL) { | ||
event.setCanceled(true); | ||
} else if (modifierSettings.doQuickReplace()) { | ||
event.setCanceled(true); | ||
if (!event.getWorld().isRemote && player instanceof EntityPlayerMP playerMP) { | ||
EffortlessBuilding.packetHandler.sendTo(new RequestLookAtMessage(true), playerMP); | ||
} | ||
} else if (!event.getWorld().isRemote && player instanceof EntityPlayerMP playerMP) { | ||
EffortlessBuilding.packetHandler.sendTo(new RequestLookAtMessage(false), playerMP); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.