mirror of
https://github.com/GTNewHorizons/ThaumicTinkerer.git
synced 2026-10-25 20:32:29 +00:00
Allow Electric Hoe of Growth to bonemeal Infused Seeds (#78)
This commit is contained in:
1 parent
8ff5a8cf52
commit
bbe1e7f50f
18 files changed
+109
-70
No files matched your search
@@ -1,5 +0,0 @@
|
||||
//version: 1707058017
|
||||
|
||||
plugins {
|
||||
id 'com.gtnewhorizons.gtnhconvention'
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
plugins {
|
||||
id("com.gtnewhorizons.gtnhconvention")
|
||||
}
|
||||
@@ -23,6 +23,9 @@ dependencies {
|
||||
compileOnly('curse.maven:computercraft-67504:2269339')
|
||||
compileOnly('curse.maven:cofh-core-69162:2388751')
|
||||
|
||||
// For testing purposes
|
||||
//runtimeOnlyNonPublishable("com.github.GTNewHorizons:Electro-Magic-Tools:1.7.6:dev")
|
||||
|
||||
runtimeOnly('com.github.GTNewHorizons:TCNEIAdditions:1.5.4:dev') {
|
||||
exclude module: 'Baubles'
|
||||
}
|
||||
|
||||
+14
-2
@@ -43,9 +43,13 @@ developmentEnvironmentUserName = Developer
|
||||
# See https://github.com/bsideup/jabel for details on how this works.
|
||||
enableModernJavaSyntax = true
|
||||
|
||||
# If set, ignores the above setting and compiles with the given toolchain. This may cause unexpected issues,
|
||||
# and should *not* be used in most situations. -1 disables this.
|
||||
# forceToolchainVersion = -1
|
||||
|
||||
# Enables injecting missing generics into the decompiled source code for a better coding experience.
|
||||
# Turns most publicly visible List, Map, etc. into proper List<E>, Map<K, V> types.
|
||||
enableGenericInjection = false
|
||||
enableGenericInjection = true
|
||||
|
||||
# Generate a class with a String field for the mod version named as defined below.
|
||||
# If generateGradleTokenClass is empty or not missing, no such class will be generated.
|
||||
@@ -96,7 +100,9 @@ usesMixinDebug = true
|
||||
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
|
||||
mixinPlugin =
|
||||
|
||||
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
|
||||
# Specify the package that contains all of your Mixins. The package must exist or
|
||||
# the build will fail. If you have a package property defined in your mixins.<modid>.json,
|
||||
# it must match with this or the build will fail.
|
||||
mixinsPackage = mixins
|
||||
|
||||
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
|
||||
@@ -172,6 +178,12 @@ curseForgeRelations =
|
||||
# projects. New projects should not use this parameter.
|
||||
# customArchiveBaseName =
|
||||
|
||||
# Optional parameter to customize the default working directory used by the runClient* tasks. Relative to the project directory.
|
||||
# runClientWorkingDirectory = run/client
|
||||
|
||||
# Optional parameter to customize the default working directory used by the runServer* tasks. Relative to the project directory.
|
||||
# runServerWorkingDirectory = run/server
|
||||
|
||||
# Optional parameter to have the build automatically fail if an illegal version is used.
|
||||
# This can be useful if you e.g. only want to allow versions in the form of '1.1.xxx'.
|
||||
# The check is ONLY performed if the version is a git tag.
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
#This file is generated by updateDaemonJvm
|
||||
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c5ee947fbfb70bc347d8d531e3a578c4/redirect
|
||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/5ee463876563a46fff651cce1bc53a4c/redirect
|
||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c5ee947fbfb70bc347d8d531e3a578c4/redirect
|
||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/5ee463876563a46fff651cce1bc53a4c/redirect
|
||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/e1118b4c7c2858d28154d086dbff010e/redirect
|
||||
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/59a9771cad43219260d9aac9a8ec4d6a/redirect
|
||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c5ee947fbfb70bc347d8d531e3a578c4/redirect
|
||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/5ee463876563a46fff651cce1bc53a4c/redirect
|
||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/832229f0f6f0be60ed817c5a5e5848eb/redirect
|
||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/b96cb7670c095245220e7d01d5927b58/redirect
|
||||
toolchainVersion=25
|
||||
Vendored
BIN
Binary file not shown.
+1
-1
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
# Copyright © 2015 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -114,7 +114,6 @@ case "$( uname )" in #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
@@ -172,7 +171,6 @@ fi
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
@@ -212,8 +210,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
|
||||
Vendored
+1
-2
@@ -70,11 +70,10 @@ goto fail
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
|
||||
@@ -3,8 +3,8 @@ pluginManagement {
|
||||
repositories {
|
||||
maven {
|
||||
// RetroFuturaGradle
|
||||
name "GTNH Maven"
|
||||
url "https://nexus.gtnewhorizons.com/repository/public/"
|
||||
name = "GTNH Maven"
|
||||
url = uri("https://nexus.gtnewhorizons.com/repository/public/")
|
||||
mavenContent {
|
||||
includeGroup("com.gtnewhorizons")
|
||||
includeGroupByRegex("com\\.gtnewhorizons\\..+")
|
||||
@@ -17,7 +17,7 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.43'
|
||||
id("com.gtnewhorizons.gtnhsettingsconvention") version "2.0.5"
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@ public class GuiAnimationTablet extends GuiContainer {
|
||||
int x, y;
|
||||
|
||||
TileAnimationTablet tablet;
|
||||
List<GuiButtonAT> buttonListAT = new ArrayList<>();
|
||||
List<IRadioButton> radioButtons = new ArrayList<>();
|
||||
|
||||
public GuiAnimationTablet(TileAnimationTablet tablet, InventoryPlayer playerInv) {
|
||||
@@ -51,25 +50,26 @@ public class GuiAnimationTablet extends GuiContainer {
|
||||
super.initGui();
|
||||
x = (width - xSize) / 2;
|
||||
y = (height - ySize) / 2;
|
||||
buttonListAT.clear();
|
||||
addButton(new GuiButtonAT(0, x + xSize / 2 - 7, y + 60, tablet.redstone));
|
||||
addButton(new GuiButtonATRadio(1, x + 52, y + 15, tablet.leftClick, radioButtons));
|
||||
addButton(new GuiButtonATRadio(2, x + 111, y + 15, !tablet.leftClick, radioButtons));
|
||||
buttonList = buttonListAT;
|
||||
}
|
||||
|
||||
private void addButton(GuiButtonAT button) {
|
||||
buttonListAT.add(button);
|
||||
buttonList.add(button);
|
||||
if (button instanceof IRadioButton) radioButtons.add((IRadioButton) button);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton par1GuiButton) {
|
||||
var button0 = (GuiButtonAT) buttonList.get(0);
|
||||
if (par1GuiButton instanceof IRadioButton) ((IRadioButton) par1GuiButton).enableFromClick();
|
||||
else buttonListAT.get(0).buttonEnabled = !buttonListAT.get(0).buttonEnabled;
|
||||
else {
|
||||
button0.buttonEnabled = !button0.buttonEnabled;
|
||||
}
|
||||
|
||||
tablet.leftClick = buttonListAT.get(1).buttonEnabled;
|
||||
tablet.redstone = buttonListAT.get(0).buttonEnabled;
|
||||
tablet.leftClick = ((GuiButtonAT) buttonList.get(1)).buttonEnabled;
|
||||
tablet.redstone = button0.buttonEnabled;
|
||||
|
||||
ThaumicTinkerer.netHandler.sendToServer(new PacketTabletButton(tablet));
|
||||
}
|
||||
|
||||
@@ -42,7 +42,6 @@ public class GuiMobMagnet extends GuiContainer {
|
||||
ItemStack stack = null;
|
||||
TileMobMagnet mobMagnet;
|
||||
|
||||
List<GuiButtonMM> buttonListMM = new ArrayList<>();
|
||||
List<IRadioButton> radioButtons = new ArrayList<>();
|
||||
|
||||
public GuiMobMagnet(TileMobMagnet tile, InventoryPlayer playerInv) {
|
||||
@@ -55,23 +54,21 @@ public class GuiMobMagnet extends GuiContainer {
|
||||
super.initGui();
|
||||
x = (width - xSize) / 2;
|
||||
y = (height - ySize) / 2;
|
||||
buttonListMM.clear();
|
||||
addButton(new GuiButtonMMRadio(0, x + 100, y + 28, mobMagnet.adult, radioButtons));
|
||||
addButton(new GuiButtonMMRadio(1, x + 100, y + 48, !mobMagnet.adult, radioButtons));
|
||||
buttonList = buttonListMM;
|
||||
}
|
||||
|
||||
private void addButton(GuiButtonMM button) {
|
||||
buttonListMM.add(button);
|
||||
buttonList.add(button);
|
||||
if (button instanceof IRadioButton) radioButtons.add((IRadioButton) button);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton par1GuiButton) {
|
||||
if (par1GuiButton instanceof IRadioButton) ((IRadioButton) par1GuiButton).enableFromClick();
|
||||
else buttonListMM.get(0).enabled = !buttonListMM.get(0).enabled;
|
||||
else buttonList.get(0).enabled = !buttonList.get(0).enabled;
|
||||
|
||||
mobMagnet.adult = buttonListMM.get(0).enabled;
|
||||
mobMagnet.adult = buttonList.get(0).enabled;
|
||||
|
||||
ThaumicTinkerer.netHandler.sendToServer(new PacketMobMagnetButton(mobMagnet));
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@ public class GuiRemotePlacer extends GuiContainer {
|
||||
|
||||
int x, y;
|
||||
List<IRadioButton> radioButtons = new ArrayList<>();
|
||||
List<GuiButtonRP> buttonListRP = new ArrayList<>();
|
||||
TileRPlacer placer;
|
||||
Aspect aspectHovered = null;
|
||||
|
||||
@@ -43,23 +42,24 @@ public class GuiRemotePlacer extends GuiContainer {
|
||||
super.initGui();
|
||||
x = (width - xSize) / 2;
|
||||
y = (height - ySize) / 2;
|
||||
buttonListRP.clear();
|
||||
addButton(new GuiButtonRPRadio(0, x + 100, y + 0, placer.blocks == 1, radioButtons));
|
||||
addButton(new GuiButtonRPRadio(1, x + 100, y + 13, placer.blocks == 2, radioButtons));
|
||||
addButton(new GuiButtonRPRadio(2, x + 100, y + 26, placer.blocks == 3, radioButtons));
|
||||
addButton(new GuiButtonRPRadio(3, x + 100, y + 39, placer.blocks == 4, radioButtons));
|
||||
buttonList = buttonListRP;
|
||||
}
|
||||
|
||||
private void addButton(GuiButtonRP button) {
|
||||
buttonListRP.add(button);
|
||||
buttonList.add(button);
|
||||
if (button instanceof IRadioButton) radioButtons.add((IRadioButton) button);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton par1GuiButton) {
|
||||
if (par1GuiButton instanceof IRadioButton) ((IRadioButton) par1GuiButton).enableFromClick();
|
||||
else buttonListRP.get(0).buttonEnabled = !buttonListRP.get(0).buttonEnabled;
|
||||
if (par1GuiButton instanceof IRadioButton iRadioButton) iRadioButton.enableFromClick();
|
||||
else {
|
||||
var button0 = (GuiButtonRP) buttonList.get(0);
|
||||
button0.buttonEnabled = !button0.buttonEnabled;
|
||||
}
|
||||
|
||||
placer.blocks = par1GuiButton.id + 1;
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package thaumic.tinkerer.common.compat;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class EMTCompat {
|
||||
|
||||
public static final boolean EMTLoaded = Loader.isModLoaded("EMT");
|
||||
public static Item electricHoe;
|
||||
|
||||
public static void init() {
|
||||
electricHoe = GameRegistry.findItem("EMT", "ElectricHoeGrowth");
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package thaumic.tinkerer.common.core.helper;
|
||||
|
||||
import net.minecraft.block.IGrowable;
|
||||
import static thaumic.tinkerer.common.compat.EMTCompat.EMTLoaded;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.event.entity.player.BonemealEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
|
||||
@@ -8,6 +10,7 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
import thaumic.tinkerer.common.block.BlockInfusedGrain;
|
||||
import thaumic.tinkerer.common.compat.EMTCompat;
|
||||
import thaumic.tinkerer.common.core.handler.ConfigHandler;
|
||||
|
||||
/**
|
||||
@@ -26,26 +29,31 @@ public class BonemealEventHandler {
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isMagicHoe(ItemStack stack) {
|
||||
if (stack == null) return false;
|
||||
var item = stack.getItem();
|
||||
return item == ConfigItems.itemHoeElemental || (EMTLoaded && item == EMTCompat.electricHoe);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerInteract(PlayerInteractEvent event) {
|
||||
if (!event.world.isRemote) {
|
||||
if (event.world.getBlock(event.x, event.y, event.z) instanceof BlockInfusedGrain) {
|
||||
if (event.entityPlayer != null && event.entityPlayer.getCurrentEquippedItem() != null) {
|
||||
if (event.entityPlayer.getCurrentEquippedItem().getItem() == ConfigItems.itemHoeElemental) {
|
||||
IGrowable igrowable = (IGrowable) event.world.getBlock(event.x, event.y, event.z);
|
||||
var world = event.world;
|
||||
if (world.isRemote) return;
|
||||
if (!(world.getBlock(event.x, event.y, event.z) instanceof BlockInfusedGrain igrowable)) return;
|
||||
|
||||
if (igrowable.func_149851_a(event.world, event.x, event.y, event.z, event.world.isRemote)) {
|
||||
if (!event.world.isRemote) {
|
||||
if (igrowable.func_149852_a(event.world, event.world.rand, event.x, event.y, event.z)) {
|
||||
igrowable.func_149853_b(event.world, event.world.rand, event.x, event.y, event.z);
|
||||
}
|
||||
}
|
||||
}
|
||||
event.entityPlayer.getCurrentEquippedItem().damageItem(25, event.entityPlayer);
|
||||
Thaumcraft.proxy.blockSparkle(event.world, event.x, event.y, event.z, 0, 2);
|
||||
}
|
||||
}
|
||||
var player = event.entityPlayer;
|
||||
if (player == null) return;
|
||||
|
||||
var hoeOfGrowth = player.getCurrentEquippedItem();
|
||||
if (!isMagicHoe(hoeOfGrowth)) return;
|
||||
|
||||
if (igrowable.func_149851_a(world, event.x, event.y, event.z, false)) {
|
||||
if (igrowable.func_149852_a(world, world.rand, event.x, event.y, event.z)) {
|
||||
igrowable.func_149853_b(world, world.rand, event.x, event.y, event.z);
|
||||
}
|
||||
}
|
||||
|
||||
hoeOfGrowth.damageItem(25, player);
|
||||
Thaumcraft.proxy.blockSparkle(world, event.x, event.y, event.z, 0, 2);
|
||||
}
|
||||
}
|
||||
@@ -51,6 +51,7 @@ import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
import thaumic.tinkerer.common.block.tile.TileFunnel;
|
||||
import thaumic.tinkerer.common.block.tile.TileRepairer;
|
||||
import thaumic.tinkerer.common.block.tile.transvector.TileTransvectorInterface;
|
||||
import thaumic.tinkerer.common.compat.EMTCompat;
|
||||
import thaumic.tinkerer.common.compat.EnderIO;
|
||||
import thaumic.tinkerer.common.compat.FumeTool;
|
||||
import thaumic.tinkerer.common.core.handler.ConfigHandler;
|
||||
@@ -158,6 +159,8 @@ public class TTCommonProxy {
|
||||
} else {
|
||||
ThaumicTinkerer.log.info("Skipping TC Multipart integration");
|
||||
}
|
||||
|
||||
EMTCompat.init();
|
||||
}
|
||||
|
||||
protected void registerPackets() {
|
||||
|
||||
@@ -64,7 +64,7 @@ public class ItemFocusDeflect extends ItemModFocus {
|
||||
range = wand.getFocusEnlarge(stack);
|
||||
}
|
||||
|
||||
List<Entity> projectiles = p.worldObj.getEntitiesWithinAABB(
|
||||
var projectiles = p.worldObj.getEntitiesWithinAABB(
|
||||
IProjectile.class,
|
||||
AxisAlignedBB.getBoundingBox(
|
||||
p.posX - (4 + range),
|
||||
@@ -74,7 +74,9 @@ public class ItemFocusDeflect extends ItemModFocus {
|
||||
p.posY + (3 + range),
|
||||
p.posZ + (3 + range)));
|
||||
|
||||
for (Entity e : projectiles) {
|
||||
for (var projectile : projectiles) {
|
||||
if (!(projectile instanceof Entity e)) continue;
|
||||
|
||||
if (CheckBlackList(e) || ProjectileHelper.getOwner(e) == p) continue;
|
||||
Vector3 motionVec = new Vector3(e.motionX, e.motionY, e.motionZ).normalize().multiply(
|
||||
Math.sqrt(
|
||||
@@ -102,19 +104,11 @@ public class ItemFocusDeflect extends ItemModFocus {
|
||||
|
||||
@Override
|
||||
public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack itemstack, int rank) {
|
||||
switch (rank) {
|
||||
case 1:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal };
|
||||
case 2:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.enlarge };
|
||||
case 3:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal };
|
||||
case 4:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.enlarge };
|
||||
case 5:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal };
|
||||
}
|
||||
return null;
|
||||
return switch (rank) {
|
||||
case 1, 3, 5 -> new FocusUpgradeType[] { FocusUpgradeType.frugal };
|
||||
case 2, 4 -> new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.enlarge };
|
||||
default -> null;
|
||||
};
|
||||
}
|
||||
|
||||
private static boolean CheckBlackList(Entity entity) {
|
||||
|
||||
@@ -81,7 +81,7 @@ public class ItemIchorSwordAdv extends ItemIchorSword implements IAdvancedTool {
|
||||
break;
|
||||
case 1: {
|
||||
int range = 3;
|
||||
List<Entity> entities = player.worldObj.getEntitiesWithinAABB(
|
||||
var entities = player.worldObj.getEntitiesWithinAABB(
|
||||
entity.getClass(),
|
||||
AxisAlignedBB.getBoundingBox(
|
||||
entity.posX - range,
|
||||
|
||||
Reference in new issue
Block a user