Compare commits

..
29 Commits
Author SHA1 Message Date
Dream Master 15f5b362b0 Merge remote-tracking branch 'ReignOfFROZE/master' into dev
# Conflicts:
#	dependencies.gradle
2025-07-16 09:51:31 +07:00
Caedis b771a32c0b Merge branch 'master' into master 2025-07-15 12:02:47 -05:00
Caedis dfd15d8a63 remove mavenLocal 2025-07-15 12:02:05 -05:00
Caedis 73a4fda220 fix syncedkeybind update 2025-07-15 12:01:07 -05:00
Dream Master 8d5c3b77a6 update 2025-07-15 22:22:59 +07:00
Dream Master 1b60db4c69 Merge branch 'master' into dev 2025-07-15 22:22:17 +07:00
Martin Robertz e7086a3472 Merge branch 'master' into master 2025-06-22 12:45:01 +02:00
Martin Robertz a79074e250 Merge remote-tracking branch 'ReignOfFROZE/master' into dev 2025-06-19 21:33:47 +02:00
ReignOfFROZE 77f94fa595 Remove SU loaded check 2025-06-19 15:10:54 -04:00
Martin Robertz 8ab8532915 Merge remote-tracking branch 'ReignOfFROZE/master' into dev 2025-06-19 21:10:42 +02:00
Martin Robertz 67242aa138 Merge branch 'master' into dev 2025-06-19 21:10:38 +02:00
ReignOfFROZE 963975864c Comments 2 2025-06-19 14:53:43 -04:00
ReignOfFROZE 658c4231c4 Comments 2025-06-03 15:36:13 -04:00
Martin Robertz 8b9b4fe25a more h4 2025-04-30 18:04:34 +02:00
Martin Robertz ffd5570bcf update and fix 2025-04-30 17:48:52 +02:00
Martin Robertz 2c50a0ff16 Merge branch 'master' into master 2025-04-30 16:16:16 +02:00
Martin Robertz 54abc5edc1 sa+update deps 2025-04-30 16:15:39 +02:00
Martin Robertz 997da93033 Merge branch 'master' into master 2025-04-30 16:00:31 +02:00
ReignOfFROZE bbcf3a8669 Moved keybind to CommonProxy 2025-04-20 11:52:25 -04:00
ReignOfFROZE f1473bbb3a Bapy-ized textures 2025-04-20 11:49:45 -04:00
ReignOfFROZE 086b0a00ff Spotless 2025-04-20 11:48:23 -04:00
ReignOfFROZE 6a4886796a Switched to using SyncedKeybind instead of vanilla keybind implementation 2025-04-20 11:46:35 -04:00
ReignOfFROZE e6c82d422d Revert file mode changes 2025-04-20 11:24:25 -04:00
ReignOfFROZE b4b6f4e5eb Spotless apply 2025-04-11 18:45:17 -04:00
reign dfe910ebd3 Fix a few bugs, add removal checking 2025-04-11 18:39:15 -04:00
reign 5b0b9ba3c5 Streamline codepaths and add SU compat for permission checking 2025-04-09 21:35:01 -04:00
reign bd76be4f6f Comment out GT5U Dependency 2025-04-08 10:58:39 -04:00
reign d3e258dd30 Remove logs and found workaround for updating mode bug 2025-04-08 10:56:50 -04:00
reign 0999964f1a Add removing and updating modes to ItemConstructableTrigger 2025-04-07 21:03:28 -04:00
49 changed files with 520 additions and 303 deletions

No files matched your search

-17
View File
@@ -1,17 +0,0 @@
name: Optimize images
on:
pull_request:
branches: [ master, main, release/** ]
paths:
- "**/*.png"
push:
branches: [ master, main, release/** ]
paths:
- "**/*.png"
jobs:
optimize-images:
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/optimize-images.yml@master
secrets: inherit
+1 -2
View File
@@ -1,7 +1,7 @@
javadoc { javadoc {
javadocTool = javaToolchains.javadocToolFor { javadocTool = javaToolchains.javadocToolFor {
// Last version with frames, but it also has search // Last version with frames, but it also has search
languageVersion = JavaLanguageVersion.of(11) languageVersion = JavaLanguageVersion.of(21)
vendor = JvmVendorSpec.ADOPTIUM vendor = JvmVendorSpec.ADOPTIUM
} }
@@ -20,7 +20,6 @@ javadoc {
overview "src/main/javadoc/overview.html" overview "src/main/javadoc/overview.html"
links 'https://docs.oracle.com/javase/8/docs/api/' links 'https://docs.oracle.com/javase/8/docs/api/'
links 'https://skmedix.github.io/ForgeJavaDocs/javadoc/forge/1.7.10-10.13.4.1614/' links 'https://skmedix.github.io/ForgeJavaDocs/javadoc/forge/1.7.10-10.13.4.1614/'
addBooleanOption("-frames", true)
} }
} }
+6 -3
View File
@@ -1,10 +1,13 @@
// Add your dependencies here // Add your dependencies here
dependencies { dependencies {
api("com.github.GTNewHorizons:GTNHLib:0.8.44:dev") api("com.github.GTNewHorizons:GTNHLib:0.6.38:dev")
implementation("com.github.GTNewHorizons:NotEnoughItems:2.8.48-GTNH:dev") implementation("com.github.GTNewHorizons:NotEnoughItems:2.7.64-GTNH:dev")
testImplementation(platform('org.junit:junit-bom:5.9.2')) testImplementation(platform('org.junit:junit-bom:5.9.2'))
testImplementation('org.junit.jupiter:junit-jupiter') testImplementation('org.junit.jupiter:junit-jupiter')
testRuntimeOnly ('org.junit.platform:junit-platform-launcher')
// runtimeOnlyNonPublishable("com.github.GTNewHorizons:GT5-Unofficial:5.09.51.391:dev") {
// exclude group: "com.github.GTNewHorizons", module: "StructureLib"
// }
} }
+1 -16
View File
@@ -43,10 +43,6 @@ developmentEnvironmentUserName = Developer
# See https://github.com/bsideup/jabel for details on how this works. # See https://github.com/bsideup/jabel for details on how this works.
enableModernJavaSyntax = true 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. # 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. # Turns most publicly visible List, Map, etc. into proper List<E>, Map<K, V> types.
enableGenericInjection = true enableGenericInjection = true
@@ -100,9 +96,7 @@ usesMixinDebug = false
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise. # Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
mixinPlugin = mixinPlugin =
# Specify the package that contains all of your Mixins. The package must exist or # Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
# 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 mixinsPackage = mixins
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin! # Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
@@ -178,12 +172,6 @@ curseForgeRelations =
# projects. New projects should not use this parameter. # projects. New projects should not use this parameter.
# customArchiveBaseName = # 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. # 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'. # 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. # The check is ONLY performed if the version is a git tag.
@@ -213,6 +201,3 @@ curseForgeRelations =
# This is meant to be set in $HOME/.gradle/gradle.properties. # This is meant to be set in $HOME/.gradle/gradle.properties.
# ideaCheckSpotlessOnBuild = true # ideaCheckSpotlessOnBuild = true
# Non-GTNH properties
org.gradle.configuration-cache = true
org.gradle.parallel = true
-12
View File
@@ -1,12 +0,0 @@
#This file is generated by updateDaemonJvm
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/df211d3c3eefdc408b462041881bc575/redirect
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/b41931cf1e70bc8e08d7dd19c343ef00/redirect
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/df211d3c3eefdc408b462041881bc575/redirect
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/b41931cf1e70bc8e08d7dd19c343ef00/redirect
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/46949723aaa20c7b64d7ecfed7207034/redirect
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/d6690dfd71c4c91e08577437b5b2beb0/redirect
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/df211d3c3eefdc408b462041881bc575/redirect
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/b41931cf1e70bc8e08d7dd19c343ef00/redirect
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/3cd7045fca9a72cd9bc7d14a385e594c/redirect
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/552c7bffe0370c66410a51c55985b511/redirect
toolchainVersion=25
Binary file not shown.
+1 -1
View File
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
networkTimeout=10000 networkTimeout=10000
validateDistributionUrl=true validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
Vendored
+5 -2
View File
@@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# #
# Copyright © 2015 the original authors. # Copyright © 2015-2021 the original authors.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@@ -114,6 +114,7 @@ case "$( uname )" in #(
NONSTOP* ) nonstop=true ;; NONSTOP* ) nonstop=true ;;
esac esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM. # Determine the Java command to use to start the JVM.
@@ -171,6 +172,7 @@ fi
# For Cygwin or MSYS, switch paths to Windows format before running java # For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" ) JAVACMD=$( cygpath --unix "$JAVACMD" )
@@ -210,7 +212,8 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
set -- \ set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \ "-Dorg.gradle.appname=$APP_BASE_NAME" \
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ -classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@" "$@"
# Stop when "xargs" is not available. # Stop when "xargs" is not available.
Vendored
+2 -1
View File
@@ -70,10 +70,11 @@ goto fail
:execute :execute
@rem Setup the command line @rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle @rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end :end
@rem End local scope for the variables with windows NT shell @rem End local scope for the variables with windows NT shell
+1 -1
View File
@@ -17,7 +17,7 @@ pluginManagement {
} }
plugins { plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.10' id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.41'
} }
@@ -14,6 +14,8 @@ import net.minecraft.util.IIcon;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;
import com.gtnewhorizon.gtnhlib.keybind.SyncedKeybind;
import com.gtnewhorizon.structurelib.item.ItemConstructableTrigger;
import com.gtnewhorizon.structurelib.net.ErrorHintParticleMessage; import com.gtnewhorizon.structurelib.net.ErrorHintParticleMessage;
import com.gtnewhorizon.structurelib.net.UpdateHintParticleMessage; import com.gtnewhorizon.structurelib.net.UpdateHintParticleMessage;
@@ -108,6 +110,17 @@ public class CommonProxy {
} }
} }
private static final SyncedKeybind MODE_SWAP_KEY = SyncedKeybind.createConfigurable(
"item.structurelib.constructableTrigger.keys.cycleMode",
"item.structurelib.constructableTrigger.keyCategory",
0).registerGlobalListener((entityPlayerMP, syncedKeybind, isDown) -> {
if (!isDown) return;
final ItemStack held = entityPlayerMP.getHeldItem();
if (held != null && held.getItem() instanceof ItemConstructableTrigger) {
ItemConstructableTrigger.cycleMode(held);
}
});
public void displayConfigGUI(String category) {} public void displayConfigGUI(String category) {}
public static class ForgeEventHandler { public static class ForgeEventHandler {
@@ -1,8 +1,12 @@
package com.gtnewhorizon.structurelib; package com.gtnewhorizon.structurelib;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import net.minecraft.world.World;
public interface IStructureCompat { public interface IStructureCompat {
void markTextureUsed(IIcon o); void markTextureUsed(IIcon o);
boolean checkServerUtilitiesPermission(World world, EntityPlayer actor, int x, int z);
} }
@@ -92,7 +92,7 @@ public class StructureLib {
@Mod.Instance @Mod.Instance
static StructureLib INSTANCE; static StructureLib INSTANCE;
@Mod.Instance(STRUCTURECOMPAT_MODID) @Mod.Instance(STRUCTURECOMPAT_MODID)
static Object COMPAT; public static Object COMPAT;
static Block blockHint; static Block blockHint;
static Item itemBlockHint; static Item itemBlockHint;
@@ -14,28 +14,8 @@ import com.gtnewhorizon.structurelib.alignment.enumerable.Rotation;
public interface IAlignmentLimits { public interface IAlignmentLimits {
/**
* Can be placed in any orientation.
*/
IAlignmentLimits UNLIMITED = (direction, rotation, flip) -> true; IAlignmentLimits UNLIMITED = (direction, rotation, flip) -> true;
/**
* Must be standing upright; i.e., top side of the block facing up.
*/
IAlignmentLimits UPRIGHT = (direction, rotation, flip) -> direction.offsetY == 0
&& (flip.isVerticallyFliped() ? rotation.isUpsideDown() : rotation.isNotRotated());
/**
* Can be in any orientation except upside down; i.e., top side of the block facing down.
*/
IAlignmentLimits NOT_UPSIDE_DOWN = (direction, rotation, flip) -> direction.offsetY != 0
|| (flip.isVerticallyFliped() ? !rotation.isNotRotated() : !rotation.isUpsideDown());
/**
* Front side of the block must be facing up.
*/
IAlignmentLimits FACING_UP = (direction, rotation, flip) -> direction == ForgeDirection.UP;
boolean isNewExtendedFacingValid(ForgeDirection direction, Rotation rotation, Flip flip); boolean isNewExtendedFacingValid(ForgeDirection direction, Rotation rotation, Flip flip);
default boolean isNewExtendedFacingValid(ExtendedFacing alignment) { default boolean isNewExtendedFacingValid(ExtendedFacing alignment) {
@@ -57,12 +57,12 @@ public class ConstructableUtility {
} }
IConstructable constructable = null; IConstructable constructable = null;
if (tTileEntity instanceof IConstructableProvider) if (tTileEntity instanceof IConstructableProvider aConstructableProvider)
constructable = ((IConstructableProvider) tTileEntity).getConstructable(); constructable = aConstructableProvider.getConstructable();
else if (tTileEntity instanceof IConstructable) { else if (tTileEntity instanceof IConstructable aConstructable) {
constructable = (IConstructable) tTileEntity; constructable = aConstructable;
} else if (IMultiblockInfoContainer.contains(tTileEntity.getClass())) { } else if (IMultiblockInfoContainer.contains(tTileEntity.getClass())) {
ExtendedFacing facing = tTileEntity instanceof IAlignment ? ((IAlignment) tTileEntity).getExtendedFacing() ExtendedFacing facing = tTileEntity instanceof IAlignment alignment ? alignment.getExtendedFacing()
: ExtendedFacing.of(ForgeDirection.getOrientation(aSide)); : ExtendedFacing.of(ForgeDirection.getOrientation(aSide));
constructable = IMultiblockInfoContainer.<TileEntity>get(tTileEntity.getClass()) constructable = IMultiblockInfoContainer.<TileEntity>get(tTileEntity.getClass())
.toConstructable(tTileEntity, facing); .toConstructable(tTileEntity, facing);
@@ -70,14 +70,13 @@ public class ConstructableUtility {
if (constructable == null) return false; if (constructable == null) return false;
if (aPlayer instanceof EntityPlayerMP) { if (aPlayer instanceof EntityPlayerMP playerMP) {
EntityPlayerMP playerMP = (EntityPlayerMP) aPlayer;
// server side and sneaking (already checked above) // server side and sneaking (already checked above)
// do construct // do construct
if (aPlayer.capabilities.isCreativeMode) { if (aPlayer.capabilities.isCreativeMode) {
constructable.construct(aStack, false); constructable.construct(aStack, false);
} else if (constructable instanceof ISurvivalConstructable) { } else if (constructable instanceof ISurvivalConstructable aConstructable) {
int built = ((ISurvivalConstructable) constructable).survivalConstruct( int built = aConstructable.survivalConstruct(
aStack, aStack,
ConfigurationHandler.INSTANCE.getAutoPlaceBudget(), ConfigurationHandler.INSTANCE.getAutoPlaceBudget(),
ISurvivalBuildEnvironment.create(IItemSource.fromPlayer(playerMP), playerMP)); ISurvivalBuildEnvironment.create(IItemSource.fromPlayer(playerMP), playerMP));
@@ -50,10 +50,6 @@ public class BlockHint extends Block {
@Override @Override
public IIcon getIcon(int aSide, int aMeta) { public IIcon getIcon(int aSide, int aMeta) {
// For numbered hints, top and bottom are blank
if (aSide <= 1 && aMeta <= 11) {
return hint[13];
}
return hint[aMeta]; return hint[aMeta];
} }
@@ -164,17 +164,40 @@ public class GuiScreenConfigureChannels extends GuiContainer implements IGuiScre
list.onGuiInit(this); list.onGuiInit(this);
autoCompleteList.onGuiInit(this); autoCompleteList.onGuiInit(this);
addButton(new GuiButton(ADD_BTN, guiLeft + 12, guiTop + 157, 47, 20, I18n.format(I18N_PREFIX + "add"))); addButton(
addButton(new GuiButton(UNSET_BTN, guiLeft + 65, guiTop + 157, 47, 20, I18n.format(I18N_PREFIX + "unset"))); new GuiButton(
addButton(new GuiButton(WIPE_BTN, guiLeft + 118, guiTop + 157, 47, 20, I18n.format(I18N_PREFIX + "wipe"))); ADD_BTN,
guiLeft + 12,
guiTop + 157,
47,
20,
I18n.format("item.structurelib.constructableTrigger.gui.add")));
addButton(
new GuiButton(
UNSET_BTN,
guiLeft + 65,
guiTop + 157,
47,
20,
I18n.format("item.structurelib.constructableTrigger.gui.unset")));
addButton(
new GuiButton(
WIPE_BTN,
guiLeft + 118,
guiTop + 157,
47,
20,
I18n.format("item.structurelib.constructableTrigger.gui.wipe")));
updateButtons(); updateButtons();
tooltipSplitCache.clear(); tooltipSplitCache.clear();
info = StreamSupport info = StreamSupport
.stream( .stream(
Splitter.on("\\n").split(StatCollector.translateToLocal(I18N_PREFIX + "info")).spliterator(), Splitter.on("\\n").split(
StatCollector.translateToLocal("item.structurelib.constructableTrigger.gui.info"))
.spliterator(),
false) false)
.flatMap(line -> fontRendererObj.listFormattedStringToWidth(line, width * 1 / 3).stream()) .flatMap(line -> fontRendererObj.listFormattedStringToWidth(line, width * 3 / 5).stream())
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
@@ -218,7 +241,8 @@ public class GuiScreenConfigureChannels extends GuiContainer implements IGuiScre
actionPerformed(but); actionPerformed(but);
} }
public List<GuiButton> getButtonList() { @SuppressWarnings("unchecked")
private List<GuiButton> getButtonList() {
return buttonList; return buttonList;
} }
@@ -261,11 +285,6 @@ public class GuiScreenConfigureChannels extends GuiContainer implements IGuiScre
switch (aKey) { switch (aKey) {
case Keyboard.KEY_TAB: case Keyboard.KEY_TAB:
if (key.isFocused()) { if (key.isFocused()) {
if (autoCompleteList.getSelectedElement() != null) {
key.setText(autoCompleteList.getSelectedElement());
return;
}
key.setFocused(false); key.setFocused(false);
value.setFocused(true); value.setFocused(true);
} else { } else {
@@ -303,10 +322,11 @@ public class GuiScreenConfigureChannels extends GuiContainer implements IGuiScre
} }
break; break;
} }
if (key.textboxKeyTyped(aChar, aKey) || value.textboxKeyTyped(aChar, aKey)) { if (key.textboxKeyTyped(aChar, aKey)) {
updateButtons(); updateButtons();
return; return;
} }
if (value.textboxKeyTyped(aChar, aKey)) return;
super.keyTyped(aChar, aKey); super.keyTyped(aChar, aKey);
} }
@@ -317,8 +337,7 @@ public class GuiScreenConfigureChannels extends GuiContainer implements IGuiScre
boolean existing = !StringUtils.isEmpty(keyText) && ChannelDataAccessor.hasSubChannel(trigger, keyText); boolean existing = !StringUtils.isEmpty(keyText) && ChannelDataAccessor.hasSubChannel(trigger, keyText);
getButtonList().get(ADD_BTN).displayString = existing ? I18n.format(I18N_PREFIX + "set") getButtonList().get(ADD_BTN).displayString = existing ? I18n.format(I18N_PREFIX + "set")
: I18n.format(I18N_PREFIX + "add"); : I18n.format(I18N_PREFIX + "add");
getButtonList().get(ADD_BTN).enabled = !StringUtils.isBlank(key.getText()) getButtonList().get(ADD_BTN).enabled = !StringUtils.isBlank(value.getText())
&& !StringUtils.isBlank(value.getText())
&& Integer.parseInt(value.getText()) > 0; && Integer.parseInt(value.getText()) > 0;
getButtonList().get(UNSET_BTN).enabled = existing && !StringUtils.isBlank(value.getText()); getButtonList().get(UNSET_BTN).enabled = existing && !StringUtils.isBlank(value.getText());
@@ -378,10 +397,22 @@ public class GuiScreenConfigureChannels extends GuiContainer implements IGuiScre
int topLeftY = (this.height - this.getYSize()) / 2; int topLeftY = (this.height - this.getYSize()) / 2;
drawTexturedModalRect(topLeftX, topLeftY, 0, 0, getXSize(), getYSize()); drawTexturedModalRect(topLeftX, topLeftY, 0, 0, getXSize(), getYSize());
list.drawScreen(mX, mY, partialTick); list.drawScreen(mX, mY, partialTick);
fontRendererObj.drawString(I18n.format(I18N_PREFIX + "title"), guiLeft + 12, guiTop + 9, 0); fontRendererObj.drawString(
fontRendererObj.drawString(I18n.format(I18N_PREFIX + "key"), guiLeft + 12, guiTop + 122, 0); I18n.format("item.structurelib.constructableTrigger.gui.title"),
guiLeft + 12,
guiTop + 9,
0);
fontRendererObj.drawString(
I18n.format("item.structurelib.constructableTrigger.gui.key"),
guiLeft + 12,
guiTop + 122,
0);
key.drawTextBox(); key.drawTextBox();
fontRendererObj.drawString(I18n.format(I18N_PREFIX + "value"), guiLeft + 12, guiTop + 142, 0); fontRendererObj.drawString(
I18n.format("item.structurelib.constructableTrigger.gui.value"),
guiLeft + 12,
guiTop + 142,
0);
value.drawTextBox(); value.drawTextBox();
} }
@@ -424,7 +455,7 @@ public class GuiScreenConfigureChannels extends GuiContainer implements IGuiScre
tooltip.addAll( tooltip.addAll(
fontRendererObj.listFormattedStringToWidth( fontRendererObj.listFormattedStringToWidth(
StatCollector.translateToLocalFormatted( StatCollector.translateToLocalFormatted(
I18N_PREFIX + "channels.from", "item.structurelib.constructableTrigger.gui.channels.from",
Loader.instance().getIndexedModList().get(e.getKey()).getName()), Loader.instance().getIndexedModList().get(e.getKey()).getName()),
maxLine)); maxLine));
tooltip.addAll( tooltip.addAll(
@@ -7,9 +7,11 @@ import static net.minecraft.util.StatCollector.translateToLocalFormatted;
import java.util.List; import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World; import net.minecraft.world.World;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
@@ -18,22 +20,65 @@ import com.gtnewhorizon.structurelib.StructureLib;
import com.gtnewhorizon.structurelib.alignment.constructable.ChannelDataAccessor; import com.gtnewhorizon.structurelib.alignment.constructable.ChannelDataAccessor;
import com.gtnewhorizon.structurelib.alignment.constructable.ConstructableUtility; import com.gtnewhorizon.structurelib.alignment.constructable.ConstructableUtility;
public class ItemConstructableTrigger extends Item { public class ItemConstructableTrigger extends ModeToggleableItem {
private static final IIcon[] textures = new IIcon[3];
public ItemConstructableTrigger() { public ItemConstructableTrigger() {
setUnlocalizedName("structurelib.constructableTrigger"); setUnlocalizedName("structurelib.constructableTrigger");
setTextureName(MOD_ID + ":itemConstructableTrigger");
setCreativeTab(StructureLib.creativeTab); setCreativeTab(StructureLib.creativeTab);
} }
@Override
public void registerIcons(IIconRegister register) {
textures[0] = register.registerIcon(MOD_ID + ":constructableTrigger/BUILDING");
textures[1] = register.registerIcon(MOD_ID + ":constructableTrigger/UPDATING");
textures[2] = register.registerIcon(MOD_ID + ":constructableTrigger/REMOVING");
}
@Override
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
return getIcon(stack, renderPass);
}
@Override
public IIcon getIcon(ItemStack stack, int pass) {
if (!stack.hasTagCompound() || !stack.getTagCompound().hasKey(TAG_MODE)) {
return textures[0];
}
return textures[stack.getTagCompound().getInteger(TAG_MODE)];
}
@Override
public String getItemStackDisplayName(ItemStack stack) {
if (!stack.hasTagCompound() || !stack.getTagCompound().hasKey(TAG_MODE)) {
return getDisplayName(0);
}
return getDisplayName(stack.getTagCompound().getInteger(TAG_MODE));
}
@Override
public IIcon getIconIndex(ItemStack stack) {
return getIcon(stack, 0);
}
@Override
public IIcon getIconFromDamage(int damage) {
return textures[damage];
}
private String getDisplayName(int mode) {
return StatCollector.translateToLocal("item.structurelib.constructableTrigger.name") + " - "
+ StatCollector.translateToLocal("item.structurelib.constructableTrigger.modes." + mode);
}
@Override @Override
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
if (getMovingObjectPositionFromPlayer(world, player, true) == null) { if (!world.isRemote && getMovingObjectPositionFromPlayer(world, player, true) == null) {
// channel gui is opened from server and config gui from client if (player.isSneaking()) {
if (!world.isRemote && !player.isSneaking()) {
player.openGui(StructureLib.instance(), 0, world, player.inventory.currentItem, 0, 0);
} else if (world.isRemote && player.isSneaking()) {
StructureLib.instance().proxy().displayConfigGUI("registries"); StructureLib.instance().proxy().displayConfigGUI("registries");
} else {
player.openGui(StructureLib.instance(), 0, world, player.inventory.currentItem, 0, 0);
} }
} }
return super.onItemRightClick(stack, world, player); return super.onItemRightClick(stack, world, player);
@@ -0,0 +1,32 @@
package com.gtnewhorizon.structurelib.item;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagInt;
public class ModeToggleableItem extends Item {
public enum TriggerMode {
BUILDING,
UPDATING,
REMOVING
}
public static TriggerMode getMode(ItemStack held) {
if (held == null || !held.hasTagCompound() || !held.getTagCompound().hasKey(TAG_MODE)) {
// default behavior
return TriggerMode.BUILDING;
}
// get user-defined mode
return TriggerMode.values()[held.getTagCompound().getInteger(TAG_MODE)];
}
public static void cycleMode(ItemStack held) {
if (held.getTagCompound() == null) held.setTagCompound(new NBTTagCompound());
if (!held.getTagCompound().hasKey(TAG_MODE)) held.getTagCompound().setTag(TAG_MODE, new NBTTagInt(0));
held.getTagCompound().setInteger(TAG_MODE, (held.getTagCompound().getInteger(TAG_MODE) + 1) % 3);
}
protected static final String TAG_MODE = "mode";
}
@@ -319,22 +319,6 @@ public interface IStructureDefinition<T> {
return walker.getBuilt(); return walker.getBuilt();
} }
default void iterate(String piece, World world, ExtendedFacing extendedFacing, int basePositionX, int basePositionY,
int basePositionZ, int basePositionA, int basePositionB, int basePositionC, IStructureWalker<T> predicate) {
StructureUtility.iterateV2(
getStructureFor(piece),
world,
extendedFacing,
basePositionX,
basePositionY,
basePositionZ,
basePositionA,
basePositionB,
basePositionC,
predicate,
"customIterate");
}
/** /**
* Low level utility. * Low level utility.
* *
@@ -364,77 +348,47 @@ public interface IStructureDefinition<T> {
} }
if (checkBlocksIfNotNullForceCheckAllIfTrue != null) { if (checkBlocksIfNotNullForceCheckAllIfTrue != null) {
boolean success; boolean success = StructureUtility.iterateV2(
if (checkBlocksIfNotNullForceCheckAllIfTrue) { elements,
success = StructureUtility.iterateV2( world,
elements, extendedFacing,
world, basePositionX,
extendedFacing, basePositionY,
basePositionX, basePositionZ,
basePositionY, basePositionA,
basePositionZ, basePositionB,
basePositionA, basePositionC,
basePositionB, checkBlocksIfNotNullForceCheckAllIfTrue ? (e, w, x, y, z, a, b, c) -> e.check(object, w, x, y, z)
basePositionC, : skipBlockUnloaded((e, w, x, y, z, a, b, c) -> e.check(object, w, x, y, z)),
(e, w, x, y, z, a, b, c) -> e.check(object, w, x, y, z), checkBlocksIfNotNullForceCheckAllIfTrue ? "check" : "check force");
"check");
} else {
success = StructureUtility.iterateV2(
elements,
world,
extendedFacing,
basePositionX,
basePositionY,
basePositionZ,
basePositionA,
basePositionB,
basePositionC,
skipBlockUnloaded((e, w, x, y, z, a, b, c) -> e.check(object, w, x, y, z)),
"check force");
}
if (StructureLibAPI.isDebugEnabled() && success) { if (StructureLibAPI.isDebugEnabled() && success) {
StructureLib.LOGGER StructureLib.LOGGER
.info("Multi [" + basePositionX + ", " + basePositionY + ", " + basePositionZ + "] pass"); .info("Multi [" + basePositionX + ", " + basePositionY + ", " + basePositionZ + "] pass");
} }
return success; return success;
} else { } else {
if (hintsOnly) { StructureUtility.iterateV2(
StructureUtility.iterateV2( elements,
elements, world,
world, extendedFacing,
extendedFacing, basePositionX,
basePositionX, basePositionY,
basePositionY, basePositionZ,
basePositionZ, basePositionA,
basePositionA, basePositionB,
basePositionB, basePositionC,
basePositionC, hintsOnly ? ignoreBlockUnloaded((e, w, x, y, z, a, b, c) -> {
ignoreBlockUnloaded((e, w, x, y, z, a, b, c) -> { e.spawnHint(object, world, x, y, z, trigger);
e.spawnHint(object, world, x, y, z, trigger); if (ChannelDataAccessor.hasSubChannel(trigger, "show_error")
if (ChannelDataAccessor.hasSubChannel(trigger, StructureLibAPI.CHANNEL_SHOW_ERROR) && !e.couldBeValid(object, world, x, y, z, trigger)) {
&& !e.couldBeValid(object, world, x, y, z, trigger)) { StructureLibAPI.markHintParticleError(StructureLib.getCurrentPlayer(), world, x, y, z);
StructureLibAPI.markHintParticleError(StructureLib.getCurrentPlayer(), world, x, y, z); }
} return true;
return true; }) : ignoreBlockUnloaded((e, w, x, y, z, a, b, c) -> {
}), e.placeBlock(object, world, x, y, z, trigger);
"spawnHint"); return true;
} else { }),
StructureUtility.iterateV2( hintsOnly ? "spawnHint" : "placeBlock");
elements,
world,
extendedFacing,
basePositionX,
basePositionY,
basePositionZ,
basePositionA,
basePositionB,
basePositionC,
ignoreBlockUnloaded((e, w, x, y, z, a, b, c) -> {
e.placeBlock(object, world, x, y, z, trigger);
return true;
}),
"placeBlock");
}
} }
return true; return true;
} }
@@ -2,6 +2,8 @@ package com.gtnewhorizon.structurelib.structure;
import static com.gtnewhorizon.structurelib.StructureLib.LOGGER; import static com.gtnewhorizon.structurelib.StructureLib.LOGGER;
import static com.gtnewhorizon.structurelib.StructureLib.PANIC_MODE; import static com.gtnewhorizon.structurelib.StructureLib.PANIC_MODE;
import static com.gtnewhorizon.structurelib.item.ModeToggleableItem.TriggerMode.REMOVING;
import static com.gtnewhorizon.structurelib.structure.StructureUtility.checkForRemoving;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
@@ -21,6 +23,7 @@ import net.minecraft.util.IChatComponent;
import net.minecraft.world.World; import net.minecraft.world.World;
import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.StructureLibAPI;
import com.gtnewhorizon.structurelib.item.ItemConstructableTrigger;
import com.gtnewhorizon.structurelib.util.ItemStackPredicate; import com.gtnewhorizon.structurelib.util.ItemStackPredicate;
import com.gtnewhorizon.structurelib.util.ItemStackPredicate.NBTMode; import com.gtnewhorizon.structurelib.util.ItemStackPredicate.NBTMode;
@@ -137,12 +140,14 @@ public interface IStructureElement<T> {
*/ */
default PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, default PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger,
AutoPlaceEnvironment env) { AutoPlaceEnvironment env) {
ItemConstructableTrigger.TriggerMode mode = ItemConstructableTrigger.getMode(trigger);
BlocksToPlace e = getBlocksToPlace(t, world, x, y, z, trigger, env); BlocksToPlace e = getBlocksToPlace(t, world, x, y, z, trigger, env);
IItemSource source = env.getSource(); IItemSource source = env.getSource();
EntityPlayer actor = env.getActor(); EntityPlayer actor = env.getActor();
Consumer<IChatComponent> chatter = env.getChatter(); Consumer<IChatComponent> chatter = env.getChatter();
if (e != null) { if (e != null) {
if (check(t, world, x, y, z)) return PlaceResult.SKIP; PlaceResult skipOrRejectBasedOnCheck = checkForRemoving(mode, check(t, world, x, y, z), world, x, y, z);
if (skipOrRejectBasedOnCheck != PlaceResult.ACCEPT) return skipOrRejectBasedOnCheck;
if (e.getStacks() == null) { if (e.getStacks() == null) {
ItemStack taken = source.takeOne(e.getPredicate(), true); ItemStack taken = source.takeOne(e.getPredicate(), true);
return StructureUtility.survivalPlaceBlock( return StructureUtility.survivalPlaceBlock(
@@ -159,7 +164,7 @@ public interface IStructureElement<T> {
chatter); chatter);
} }
for (ItemStack stack : e.getStacks()) { for (ItemStack stack : e.getStacks()) {
if (!source.takeOne(stack, true)) continue; if (mode != REMOVING && !source.takeOne(stack, true)) continue;
return StructureUtility.survivalPlaceBlock( return StructureUtility.survivalPlaceBlock(
stack, stack,
NBTMode.EXACT, NBTMode.EXACT,
@@ -2,25 +2,8 @@ package com.gtnewhorizon.structurelib.structure;
import net.minecraft.world.World; import net.minecraft.world.World;
/** interface IStructureWalker<T> {
* A functional interface that is used to iterate over an arbitrary structure.
*/
@FunctionalInterface
public interface IStructureWalker<T> {
/**
* Called once per structure element.
*
* @param element The current element
* @param world The current world
* @param x The absolute X position of the element in world coordinates
* @param y The absolute Y position of the element in world coordinates
* @param z The absolute Z position of the element in world coordinates
* @param a The relative A position of the element in structure-local coordinates (pre transform)
* @param b The relative B position of the element in structure-local coordinates (pre transform)
* @param c The relative C position of the element in structure-local coordinates (pre transform)
* @return False to stop iterating, true to continue.
*/
boolean visit(IStructureElement<T> element, World world, int x, int y, int z, int a, int b, int c); boolean visit(IStructureElement<T> element, World world, int x, int y, int z, int a, int b, int c);
default boolean blockNotLoaded(IStructureElement<T> element, World world, int x, int y, int z, int a, int b, default boolean blockNotLoaded(IStructureElement<T> element, World world, int x, int y, int z, int a, int b,
@@ -148,32 +148,15 @@ public class StructureDefinition<T> implements IStructureDefinition<T> {
occupiedSpaces.put(name, occupiedSpace); occupiedSpaces.put(name, occupiedSpace);
boolean hasPlus = false; String built = builder.toString().replaceAll("[\\uA000\\uB000\\uC000]", "");
boolean hasMinus = false;
int write = 0; if (built.contains("+")) {
for (int read = 0; read < builder.length(); read++) {
char ch = builder.charAt(read);
if (ch == A || ch == B || ch == C) {
continue;
}
if (ch == '+') {
hasPlus = true;
} else if (ch == '-') {
hasMinus = true;
}
if (read != write) builder.setCharAt(write, ch);
write++;
}
builder.setLength(write);
if (hasPlus) {
addElement('+', notAir()); addElement('+', notAir());
} }
if (hasMinus) { if (built.contains("-")) {
addElement('-', isAir()); addElement('-', isAir());
} }
shapes.put(name, builder.toString()); shapes.put(name, built);
return this; return this;
} }
@@ -2,32 +2,17 @@ package com.gtnewhorizon.structurelib.structure;
import static com.gtnewhorizon.structurelib.StructureLib.LOGGER; import static com.gtnewhorizon.structurelib.StructureLib.LOGGER;
import static com.gtnewhorizon.structurelib.StructureLib.PANIC_MODE; import static com.gtnewhorizon.structurelib.StructureLib.PANIC_MODE;
import static com.gtnewhorizon.structurelib.item.ModeToggleableItem.TriggerMode.*;
import static java.lang.Integer.MIN_VALUE; import static java.lang.Integer.MIN_VALUE;
import java.util.Arrays; import java.util.*;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.Objects; import java.util.function.*;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.function.BiConsumer;
import java.util.function.BiFunction;
import java.util.function.BiPredicate;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.function.Supplier;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
@@ -46,11 +31,13 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.Pair; import org.apache.commons.lang3.tuple.Pair;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.gtnewhorizon.structurelib.IStructureCompat;
import com.gtnewhorizon.structurelib.StructureEvent.StructureElementVisitedEvent; import com.gtnewhorizon.structurelib.StructureEvent.StructureElementVisitedEvent;
import com.gtnewhorizon.structurelib.StructureLib; import com.gtnewhorizon.structurelib.StructureLib;
import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.StructureLibAPI;
import com.gtnewhorizon.structurelib.alignment.constructable.ChannelDataAccessor; import com.gtnewhorizon.structurelib.alignment.constructable.ChannelDataAccessor;
import com.gtnewhorizon.structurelib.alignment.enumerable.ExtendedFacing; import com.gtnewhorizon.structurelib.alignment.enumerable.ExtendedFacing;
import com.gtnewhorizon.structurelib.item.ItemConstructableTrigger;
import com.gtnewhorizon.structurelib.structure.IStructureElement.PlaceResult; import com.gtnewhorizon.structurelib.structure.IStructureElement.PlaceResult;
import com.gtnewhorizon.structurelib.structure.adders.IBlockAdder; import com.gtnewhorizon.structurelib.structure.adders.IBlockAdder;
import com.gtnewhorizon.structurelib.structure.adders.ITileAdder; import com.gtnewhorizon.structurelib.structure.adders.ITileAdder;
@@ -206,7 +193,11 @@ public class StructureUtility {
@Override @Override
public boolean placeBlock(Object o, World world, int x, int y, int z, ItemStack trigger) { public boolean placeBlock(Object o, World world, int x, int y, int z, ItemStack trigger) {
world.setBlock(x, y, z, StructureLibAPI.getBlockHint(), 14, 2); placeRemoveOrUpdate(
trigger,
() -> world.setBlock(x, y, z, StructureLibAPI.getBlockHint(), 14, 2),
() -> world.setBlock(x, y, z, StructureLibAPI.getBlockHint(), 14, 2),
() -> world.setBlock(x, y, z, Blocks.air, 0, 2));
return true; return true;
} }
@@ -219,11 +210,16 @@ public class StructureUtility {
@Override @Override
public PlaceResult survivalPlaceBlock(Object o, World world, int x, int y, int z, ItemStack trigger, public PlaceResult survivalPlaceBlock(Object o, World world, int x, int y, int z, ItemStack trigger,
AutoPlaceEnvironment env) { AutoPlaceEnvironment env) {
if (check(o, world, x, y, z)) return PlaceResult.SKIP; ItemConstructableTrigger.TriggerMode mode = ItemConstructableTrigger.getMode(trigger);
if (mode != REMOVING && check(o, world, x, y, z)) return PlaceResult.SKIP;
// user should place anything here. // user should place anything here.
// maybe make this configurable, but for now we try to take some cobble from user // maybe make this configurable, but for now we try to take some cobble from user
if (env.getSource().takeOne(new ItemStack(Blocks.cobblestone), false)) { if (env.getSource().takeOne(new ItemStack(Blocks.cobblestone), false)) {
world.setBlock(x, y, z, Blocks.cobblestone, 0, 2); placeRemoveOrUpdate(
trigger,
() -> world.setBlock(x, y, z, Blocks.cobblestone, 0, 2),
() -> world.setBlock(x, y, z, Blocks.cobblestone, 0, 2),
() -> world.setBlock(x, y, z, Blocks.air, 0, 2));
} }
return PlaceResult.REJECT; return PlaceResult.REJECT;
} }
@@ -330,28 +326,91 @@ public class StructureUtility {
public static PlaceResult survivalPlaceBlock(Block block, int meta, World world, int x, int y, int z, IItemSource s, public static PlaceResult survivalPlaceBlock(Block block, int meta, World world, int x, int y, int z, IItemSource s,
EntityPlayer actor, Consumer<IChatComponent> chatter) { EntityPlayer actor, Consumer<IChatComponent> chatter) {
if (block == null) throw new NullPointerException(); if (block == null) throw new NullPointerException();
if (!StructureLibAPI.isBlockTriviallyReplaceable(world, x, y, z, actor)) return PlaceResult.REJECT; ItemConstructableTrigger.TriggerMode mode = BUILDING;
if (actor.getHeldItem() != null && actor.getHeldItem().getItem() instanceof ItemConstructableTrigger) {
// best effort lookup if the item in the player's hand is a trigger, and if it is, get the mode from the
// ...trigger instead of assuming default behavior
mode = ItemConstructableTrigger.getMode(actor.getHeldItem());
}
if (mode == BUILDING && !StructureLibAPI.isBlockTriviallyReplaceable(world, x, y, z, actor))
return PlaceResult.REJECT;
if (mode == UPDATING) {
if (!world.isAirBlock(x, y, z)) {
if (world.getTileEntity(x, y, z) instanceof TileEntity) {
// We're in updating mode and the block we're looking at might be important, so let's just leave it
// alone
// since it's probably not something we want to replace with something else
return PlaceResult.SKIP;
}
Block blockInWorld = world.getBlock(x, y, z);
if (blockInWorld.isAssociatedBlock(block) && blockInWorld.getDamageValue(world, x, y, z) == meta) {
// This is the block we are looking for, move along
return PlaceResult.SKIP;
}
}
}
Item itemBlock = Item.getItemFromBlock(block); Item itemBlock = Item.getItemFromBlock(block);
int itemMeta = itemBlock instanceof ISpecialItemBlock int itemMeta = itemBlock instanceof ISpecialItemBlock
? ((ISpecialItemBlock) itemBlock).getItemMetaFromBlockMeta(block, meta) ? ((ISpecialItemBlock) itemBlock).getItemMetaFromBlockMeta(block, meta)
: meta; : meta;
ItemStack stack = new ItemStack(itemBlock, 1, itemMeta); ItemStack stack = new ItemStack(itemBlock, 1, itemMeta);
if (!s.takeOne(stack, true)) { if (mode != REMOVING) {
if (chatter != null) chatter.accept( if (!s.takeOne(stack, true)) {
new ChatComponentTranslation( if (chatter != null) chatter.accept(
"structurelib.autoplace.error.no_simple_block", new ChatComponentTranslation(
stack.func_151000_E())); "structurelib.autoplace.error.no_simple_block",
return PlaceResult.REJECT; stack.func_151000_E()));
} return PlaceResult.REJECT;
if (block instanceof ICustomBlockSetting) { }
ICustomBlockSetting blockCustom = (ICustomBlockSetting) block; if (block instanceof ICustomBlockSetting) {
blockCustom.setBlock(world, x, y, z, meta); ICustomBlockSetting blockCustom = (ICustomBlockSetting) block;
} else if (!stack.copy() blockCustom.setBlock(world, x, y, z, meta);
.tryPlaceItemIntoWorld(actor, world, x, y, z, ForgeDirection.UP.ordinal(), 0.5f, 0.5f, 0.5f)) { } else {
if (mode == UPDATING && !world.isAirBlock(x, y, z) && checkPermission(world, actor, x, y, z)) {
// We're in updating mode and there's a block in our way (grr), so let's remove whatever is there
// ...and drop it to the player
ItemStack toGive = new ItemStack(world.getBlock(x, y, z));
toGive.setItemDamage(world.getBlock(x, y, z).getDamageValue(world, x, y, z));
if (!world.setBlock(x, y, z, Blocks.air, 0, 4) || !tryGiveOrDropItem(world, actor, toGive)) {
// We either weren't able to give the player the block that was there, or we weren't able to
// remove
// the block, either way, we need to reject the update. Also, since we hid the block update from
// the client in an effort to make the exchange as seamless as possible, we need to now notify
// the client if we did successfully remove the block.
if (world.isAirBlock(x, y, z)) world.notifyBlockChange(x, y, z, Blocks.air);
return PlaceResult.REJECT;
}
}
if (!stack.copy()
.tryPlaceItemIntoWorld(actor, world, x, y, z, ForgeDirection.UP.ordinal(), 0.5f, 0.5f, 0.5f)) {
return PlaceResult.REJECT; return PlaceResult.REJECT;
} }
if (!s.takeOne(stack, false)) { }
// rollback }
if (mode == REMOVING) {
// We're in removing mode, so let's check some stuff
if (world.isAirBlock(x, y, z)) {
return PlaceResult.SKIP;
}
ItemStack toGive = new ItemStack(world.getBlock(x, y, z));
toGive.setItemDamage(world.getBlock(x, y, z).getDamageValue(world, x, y, z));
if (!checkPermission(world, actor, x, y, z)) {
return PlaceResult.REJECT;
}
world.setBlockToAir(x, y, z);
if (!tryGiveOrDropItem(world, actor, toGive)) {
// We're in removing mode and something went wrong while trying to give the player the block we removed,
// let's just fail for now
return PlaceResult.REJECT;
}
} else if (!s.takeOne(stack, false)) {
// If the user didn't have the block in their inventory, and we're in some
// other mode, let's check some stuff
if (world.isAirBlock(x, y, z)) {
return PlaceResult.SKIP;
}
ItemStack toGive = new ItemStack(world.getBlock(x, y, z));
toGive.setItemDamage(world.getBlock(x, y, z).getDamageValue(world, x, y, z));
world.setBlockToAir(x, y, z); world.setBlockToAir(x, y, z);
} }
return PlaceResult.ACCEPT; return PlaceResult.ACCEPT;
@@ -444,24 +503,90 @@ public class StructureUtility {
if (stack == null) throw new NullPointerException(); if (stack == null) throw new NullPointerException();
if (stack.stackSize != 1) throw new IllegalArgumentException(); if (stack.stackSize != 1) throw new IllegalArgumentException();
if (!(stack.getItem() instanceof ItemBlock)) throw new IllegalArgumentException(); if (!(stack.getItem() instanceof ItemBlock)) throw new IllegalArgumentException();
if (!StructureLibAPI.isBlockTriviallyReplaceable(world, x, y, z, actor)) return PlaceResult.REJECT; ItemConstructableTrigger.TriggerMode mode = BUILDING;
if (!assumeStackPresent && !s.takeOne(stack, true)) { if (actor.getHeldItem() != null && actor.getHeldItem().getItem() instanceof ItemConstructableTrigger) {
if (chatter != null) chatter.accept( // best effort lookup if the item in the player's hand is a trigger, and if it is, get the mode from the
new ChatComponentTranslation("structurelib.autoplace.error.no_item_stack", stack.func_151000_E())); // ...trigger instead of assuming default behavior
return PlaceResult.REJECT; mode = ItemConstructableTrigger.getMode(actor.getHeldItem());
} }
if (!stack.copy().tryPlaceItemIntoWorld(actor, world, x, y, z, ForgeDirection.UP.ordinal(), 0.5f, 0.5f, 0.5f)) if (mode != REMOVING) {
return PlaceResult.REJECT; if (mode == BUILDING) {
if (!s.takeOne(stack, false)) if (!StructureLibAPI.isBlockTriviallyReplaceable(world, x, y, z, actor)) {
// this is bad! probably an exploit somehow. Let's nullify the block we just placed instead return PlaceResult.SKIP;
}
}
if (mode == UPDATING) {
if (!world.isAirBlock(x, y, z)) {
if (world.getTileEntity(x, y, z) instanceof TileEntity) {
return PlaceResult.SKIP;
}
Block blockInWorld = world.getBlock(x, y, z);
ItemStack blockInWorldItem = new ItemStack(blockInWorld);
blockInWorldItem.setItemDamage(blockInWorld.getDamageValue(world, x, y, z));
if (blockInWorldItem.isItemEqual(stack)) {
// This is the block we are looking for, move along
return PlaceResult.SKIP;
}
}
}
if (!assumeStackPresent && !s.takeOne(stack, true)) {
if (chatter != null) chatter.accept(
new ChatComponentTranslation(
"structurelib.autoplace.error.no_item_stack",
stack.func_151000_E()));
return PlaceResult.REJECT;
}
if (mode == UPDATING && !world.isAirBlock(x, y, z) && checkPermission(world, actor, x, y, z)) {
// We're in updating mode and there's a block in our way (grr), so let's remove whatever is there
// ...and drop it to the player
ItemStack toGive = new ItemStack(world.getBlock(x, y, z));
toGive.setItemDamage(world.getBlock(x, y, z).getDamageValue(world, x, y, z));
if (!world.setBlock(x, y, z, Blocks.air, 0, 4) || !tryGiveOrDropItem(world, actor, toGive)) {
// We either weren't able to give the player the block that was there, or we weren't able to remove
// the block, either way, we need to reject the update. Also, since we hid the block update from
// the client in an effort to make the exchange as seamless as possible, we need to now notify
// the client if we did successfully remove the block.
if (world.isAirBlock(x, y, z)) world.notifyBlockChange(x, y, z, Blocks.air);
return PlaceResult.REJECT;
}
}
if (!stack.copy()
.tryPlaceItemIntoWorld(actor, world, x, y, z, ForgeDirection.UP.ordinal(), 0.5f, 0.5f, 0.5f)) {
return PlaceResult.REJECT;
}
}
if (mode == REMOVING) {
if (world.isAirBlock(x, y, z)) {
return PlaceResult.SKIP;
}
// If we're in removing mode, we set it to air
ItemStack toGive = new ItemStack(world.getBlock(x, y, z));
toGive.setItemDamage(world.getBlock(x, y, z).getDamageValue(world, x, y, z));
if (!checkPermission(world, actor, x, y, z)) {
return PlaceResult.REJECT;
}
world.setBlockToAir(x, y, z); world.setBlockToAir(x, y, z);
if (!tryGiveOrDropItem(world, actor, toGive)) {
// We were in removing mode and something went wrong while trying to give the player the block we
// ...removed, let's just fail for now
return PlaceResult.REJECT;
}
} else if (!s.takeOne(stack, false)) {
if (world.isAirBlock(x, y, z)) {
return PlaceResult.SKIP;
}
// If the user didn't have the item in their inventory, we set it to air
ItemStack toGive = new ItemStack(world.getBlock(x, y, z));
toGive.setItemDamage(world.getBlock(x, y, z).getDamageValue(world, x, y, z));
world.setBlockToAir(x, y, z);
}
return PlaceResult.ACCEPT; return PlaceResult.ACCEPT;
} }
/** /**
* Return a structure element that only allow air (or air equivalents, like Railcraft hidden blocks). You usually * Return a structure element that only allow air (or air equivalents, like Railcraft hidden blocks). You usually
* don't need to call this yourselves. Use {@code -} in shape to automatically use this. Provided nontheless in case * don't need to call this yourselves. Use {@code -} in shape to automatically use this. Provided nonetheless in
* you want this as a fallback to something else. * case you want this as a fallback to something else.
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public static <T> IStructureElement<T> isAir() { public static <T> IStructureElement<T> isAir() {
@@ -470,8 +595,8 @@ public class StructureUtility {
/** /**
* Return a structure element that allow anything but air (or air equivalents, like Railcraft hidden blocks). You * Return a structure element that allow anything but air (or air equivalents, like Railcraft hidden blocks). You
* usually don't need to call this yourselves. Use {@code +} in shape to automatically use this. Provided nontheless * usually don't need to call this yourselves. Use {@code +} in shape to automatically use this. Provided
* in case you want this as a fallback to something else. * nonetheless in case you want this as a fallback to something else.
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public static <T> IStructureElement<T> notAir() { public static <T> IStructureElement<T> notAir() {
@@ -637,7 +762,7 @@ public class StructureUtility {
* given tier, then player will be allowed to use multiple kinds of blocks, but their tier is guaranteed to be the * given tier, then player will be allowed to use multiple kinds of blocks, but their tier is guaranteed to be the
* same. * same.
* <p> * <p>
* <h3>WARNING</h3> <b>You SHOULD NOT return notSet from your tierExtractor.</b> If you do so, we will have this * <h4>WARNING</h4> <b>You SHOULD NOT return notSet from your tierExtractor.</b> If you do so, we will have this
* chain of events: * chain of events:
* <ul> * <ul>
* <li>at check start, tier is reset to notSet * <li>at check start, tier is reset to notSet
@@ -650,7 +775,7 @@ public class StructureUtility {
* doing its business * doing its business
* <li>Player enjoy a (probably) hilariously shaped multi and (probably) reduced build cost. * <li>Player enjoy a (probably) hilariously shaped multi and (probably) reduced build cost.
* </ul> * </ul>
* <h3>Example Implementation</h3> * <h4>Example Implementation</h4>
* <p> * <p>
* Assume you have 16 tier, each map to one particular block's 16 different meta. You will usually want something * Assume you have 16 tier, each map to one particular block's 16 different meta. You will usually want something
* like this * like this
@@ -709,7 +834,7 @@ public class StructureUtility {
List<Pair<Block, Integer>> hints = allKnownTiers == null ? Collections.emptyList() : allKnownTiers; List<Pair<Block, Integer>> hints = allKnownTiers == null ? Collections.emptyList() : allKnownTiers;
if (hints.stream().anyMatch(Objects::isNull)) throw new IllegalArgumentException(); if (hints.stream().anyMatch(Objects::isNull)) throw new IllegalArgumentException();
IStructureElementCheckOnly<T> check = ofBlocksTiered(tierExtractor, notSet, setter, getter); IStructureElementCheckOnly<T> check = ofBlocksTiered(tierExtractor, notSet, setter, getter);
return new StructureElement_Bridge<T>() { return new StructureElement_Bridge<>() {
@Override @Override
public boolean check(T t, World world, int x, int y, int z) { public boolean check(T t, World world, int x, int y, int z) {
@@ -734,6 +859,11 @@ public class StructureUtility {
return Objects.equals(hintTier, worldTier); return Objects.equals(hintTier, worldTier);
} }
private boolean isInAllKnownTiers(Block b) {
return allKnownTiers != null
&& allKnownTiers.stream().anyMatch(pair -> pair.getLeft().isAssociatedBlock(b));
}
@Override @Override
public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
Pair<Block, Integer> hint = getHint(trigger); Pair<Block, Integer> hint = getHint(trigger);
@@ -766,13 +896,21 @@ public class StructureUtility {
@Override @Override
public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger,
AutoPlaceEnvironment env) { AutoPlaceEnvironment env) {
ItemConstructableTrigger.TriggerMode mode = ItemConstructableTrigger.getMode(trigger);
Pair<Block, Integer> hint = getHint(trigger); Pair<Block, Integer> hint = getHint(trigger);
if (hint == null) return PlaceResult.REJECT; // TODO or SKIP? if (hint == null) return PlaceResult.REJECT; // TODO or SKIP?
Block block = world.getBlock(x, y, z); Block block = world.getBlock(x, y, z);
int meta = world.getBlockMetadata(x, y, z); int meta = world.getBlockMetadata(x, y, z);
TIER tier = tierExtractor.convert(block, meta); TIER tier = tierExtractor.convert(block, meta);
if (Objects.equals(tier, tierExtractor.convert(hint.getKey(), hint.getValue()))) if (mode == REMOVING) {
return PlaceResult.SKIP; if (!isInAllKnownTiers(block) && !world.isAirBlock(x, y, z)) {
return PlaceResult.REJECT;
}
} else {
if ((Objects.equals(tier, tierExtractor.convert(hint.getKey(), hint.getValue())))) {
return PlaceResult.SKIP;
}
}
return StructureUtility.survivalPlaceBlock( return StructureUtility.survivalPlaceBlock(
hint.getKey(), hint.getKey(),
hint.getValue(), hint.getValue(),
@@ -861,7 +999,9 @@ public class StructureUtility {
@Override @Override
public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger,
AutoPlaceEnvironment env) { AutoPlaceEnvironment env) {
if (check(t, world, x, y, z)) return PlaceResult.SKIP; ItemConstructableTrigger.TriggerMode mode = ItemConstructableTrigger.getMode(trigger);
PlaceResult skipOrRejectBasedOnCheck = checkForRemoving(mode, check(t, world, x, y, z), world, x, y, z);
if (skipOrRejectBasedOnCheck != PlaceResult.ACCEPT) return skipOrRejectBasedOnCheck;
if (getBlock() == null) return PlaceResult.REJECT; if (getBlock() == null) return PlaceResult.REJECT;
return StructureUtility.survivalPlaceBlock( return StructureUtility.survivalPlaceBlock(
getBlock(), getBlock(),
@@ -948,7 +1088,9 @@ public class StructureUtility {
@Deprecated @Deprecated
public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger,
IItemSource s, EntityPlayerMP actor, Consumer<IChatComponent> chatter) { IItemSource s, EntityPlayerMP actor, Consumer<IChatComponent> chatter) {
if (check(t, world, x, y, z)) return PlaceResult.SKIP; ItemConstructableTrigger.TriggerMode mode = ItemConstructableTrigger.getMode(trigger);
PlaceResult skipOrRejectBasedOnCheck = checkForRemoving(mode, check(t, world, x, y, z), world, x, y, z);
if (skipOrRejectBasedOnCheck != PlaceResult.ACCEPT) return skipOrRejectBasedOnCheck;
if (init()) return StructureUtility.survivalPlaceBlock(block, meta, world, x, y, z, s, actor, chatter); if (init()) return StructureUtility.survivalPlaceBlock(block, meta, world, x, y, z, s, actor, chatter);
return fallback.survivalPlaceBlock(t, world, x, y, z, trigger, s, actor, chatter); return fallback.survivalPlaceBlock(t, world, x, y, z, trigger, s, actor, chatter);
} }
@@ -956,7 +1098,9 @@ public class StructureUtility {
@Override @Override
public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger,
AutoPlaceEnvironment env) { AutoPlaceEnvironment env) {
if (check(t, world, x, y, z)) return PlaceResult.SKIP; ItemConstructableTrigger.TriggerMode mode = ItemConstructableTrigger.getMode(trigger);
PlaceResult skipOrRejectBasedOnCheck = checkForRemoving(mode, check(t, world, x, y, z), world, x, y, z);
if (skipOrRejectBasedOnCheck != PlaceResult.ACCEPT) return skipOrRejectBasedOnCheck;
if (init()) return StructureUtility.survivalPlaceBlock( if (init()) return StructureUtility.survivalPlaceBlock(
block, block,
meta, meta,
@@ -1584,8 +1728,15 @@ public class StructureUtility {
@Deprecated @Deprecated
public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger,
AutoPlaceEnvironment env) { AutoPlaceEnvironment env) {
if (world.getBlock(x, y, z) == defaultBlock && world.getBlockMetadata(x, y, z) == defaultMeta) ItemConstructableTrigger.TriggerMode mode = ItemConstructableTrigger.getMode(trigger);
return PlaceResult.SKIP; PlaceResult skipOrRejectBasedOnCheck = checkForRemoving(
mode,
world.getBlock(x, y, z) == defaultBlock && world.getBlockMetadata(x, y, z) == defaultMeta,
world,
x,
y,
z);
if (skipOrRejectBasedOnCheck != PlaceResult.ACCEPT) return skipOrRejectBasedOnCheck;
return StructureUtility.survivalPlaceBlock( return StructureUtility.survivalPlaceBlock(
defaultBlock, defaultBlock,
defaultMeta, defaultMeta,
@@ -1630,8 +1781,15 @@ public class StructureUtility {
@Deprecated @Deprecated
public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger,
AutoPlaceEnvironment env) { AutoPlaceEnvironment env) {
if (world.getBlock(x, y, z) == defaultBlock && world.getBlockMetadata(x, y, z) == defaultMeta) ItemConstructableTrigger.TriggerMode mode = ItemConstructableTrigger.getMode(trigger);
return PlaceResult.SKIP; PlaceResult skipOrRejectBasedOnCheck = checkForRemoving(
mode,
world.getBlock(x, y, z) == defaultBlock && world.getBlockMetadata(x, y, z) == defaultMeta,
world,
x,
y,
z);
if (skipOrRejectBasedOnCheck != PlaceResult.ACCEPT) return skipOrRejectBasedOnCheck;
return StructureUtility.survivalPlaceBlock( return StructureUtility.survivalPlaceBlock(
defaultBlock, defaultBlock,
defaultMeta, defaultMeta,
@@ -3265,4 +3423,57 @@ public class StructureUtility {
} }
return shape; return shape;
} }
/**
* Performs a creation, removal, or update operation at the given position
*
* @param trigger ItemStack for the trigger item
* @param onCreate Operation to be performed when the mode of the trigger is set to building mode
* @param onUpdate Operation to be performed when the mode of the trigger is set to updating mode
* @param onRemove Operation to be performed when the mode of the trigger is set to removing mode
*/
public static void placeRemoveOrUpdate(ItemStack trigger, Runnable onCreate, Runnable onUpdate, Runnable onRemove) {
ItemConstructableTrigger.TriggerMode mode = ItemConstructableTrigger.getMode(trigger);
switch (mode) {
case BUILDING:
onCreate.run();
break;
case UPDATING:
onUpdate.run();
break;
case REMOVING:
onRemove.run();
break;
}
}
public static boolean tryGiveOrDropItem(World world, EntityPlayer actor, ItemStack stack) {
if (actor.inventory.addItemStackToInventory(stack)) {
actor.inventoryContainer.detectAndSendChanges();
return true;
}
EntityItem toSpawn = new EntityItem(world, actor.posX, actor.posY, actor.posZ, stack);
// For some reason these things sometimes spawn with the velocity of an F1 car, so let's prevent that
toSpawn.motionX = 0;
toSpawn.motionY = 0;
toSpawn.motionZ = 0;
return world.spawnEntityInWorld(toSpawn);
}
public static boolean checkPermission(World world, EntityPlayer actor, int x, int y, int z) {
boolean res = true;
if (StructureLib.COMPAT instanceof IStructureCompat isc) {
res = isc.checkServerUtilitiesPermission(world, actor, x, z);
}
res = res && !world.getBlock(x, y, z).isAssociatedBlock(Blocks.bedrock);
// maybe check mining level who knows :shrug:
return res;
}
public static PlaceResult checkForRemoving(ItemConstructableTrigger.TriggerMode mode, boolean checkResult,
World world, int x, int y, int z) {
if (mode != REMOVING && checkResult) return PlaceResult.SKIP;
else if (mode != BUILDING && !checkResult && !world.isAirBlock(x, y, z)) return PlaceResult.REJECT;
return PlaceResult.ACCEPT;
}
} }
+10
View File
@@ -133,6 +133,16 @@ StructureLib API documentation.
Usually there is no reason to reimplement this on your own. Usually there is no reason to reimplement this on your own.
</p> </p>
<h2>{@link com.gtnewhorizon.structurelib.item.ModeToggleableItem}</h2>
<p>
This class is the base class for {@link com.gtnewhorizon.structurelib.item.ItemConstructableTrigger} that defines
the <code>TriggerMode</code>s for the {@link com.gtnewhorizon.structurelib.item.ItemConstructableTrigger}. There are
3 modes, <code>BUILDING</code>, <code>UPDATING</code>, and <code>REMOVING</code>. Each of these modes does as they
say, where building will build a new multi from scratch, updating will remove existing an existing structure and
replace it with new components (think upgrading glass on a multi, changing from a tier 1 to tier 2 of a multi, etc),
and removing will just straight up remove the multi.
</p>
<h2><a href="#channels" id="channels">Channels</a></h2> <h2><a href="#channels" id="channels">Channels</a></h2>
<p> <p>
@@ -22,6 +22,9 @@ item.structurelib.frontRotationTool.desc.1=Rotates only the front panel,
item.structurelib.frontRotationTool.desc.2=which allows structure rotation. item.structurelib.frontRotationTool.desc.2=which allows structure rotation.
item.structurelib.constructableTrigger.name=Multiblock Structure Hologram Projector item.structurelib.constructableTrigger.name=Multiblock Structure Hologram Projector
item.structurelib.constructableTrigger.modes.0=Building Mode
item.structurelib.constructableTrigger.modes.1=Updating Mode
item.structurelib.constructableTrigger.modes.2=Removing Mode
item.structurelib.constructableTrigger.desc.0=Triggers Constructable Interface item.structurelib.constructableTrigger.desc.0=Triggers Constructable Interface
item.structurelib.constructableTrigger.desc.1=Shows multiblock construction schematic, item.structurelib.constructableTrigger.desc.1=Shows multiblock construction schematic,
item.structurelib.constructableTrigger.desc.2=use on the multiblock controller. item.structurelib.constructableTrigger.desc.2=use on the multiblock controller.
@@ -34,11 +37,17 @@ item.structurelib.constructableTrigger.gui.title=Sub Channels
item.structurelib.constructableTrigger.gui.key=Key: item.structurelib.constructableTrigger.gui.key=Key:
item.structurelib.constructableTrigger.gui.value=Value: item.structurelib.constructableTrigger.gui.value=Value:
item.structurelib.constructableTrigger.gui.add=Add item.structurelib.constructableTrigger.gui.add=Add
item.structurelib.constructableTrigger.gui.set=Update item.structurelib.constructableTrigger.gui.set=Set
item.structurelib.constructableTrigger.gui.unset=Remove item.structurelib.constructableTrigger.gui.unset=Unset
item.structurelib.constructableTrigger.gui.wipe=§4Clear item.structurelib.constructableTrigger.gui.wipe=§4Wipe
item.structurelib.constructableTrigger.gui.error.show=Show Errors
item.structurelib.constructableTrigger.gui.error.hide=Hide Errors
item.structurelib.constructableTrigger.gui.gt_no_hatch.enable=No Hatch
item.structurelib.constructableTrigger.gui.gt_no_hatch.disable=Hatches
item.structurelib.constructableTrigger.keyCategory=Multiblock Structure Hologram Projector Keys
item.structurelib.constructableTrigger.keys.cycleMode=Cycle Projector Mode
item.structurelib.constructableTrigger.gui.channels.from=§rMod: §9§o%s item.structurelib.constructableTrigger.gui.channels.from=§rMod: §9§o%s
item.structurelib.constructableTrigger.gui.info=Many multiblocks support some degree of variation in their structure and a sub channel allows indication of which variant to use.\n All sub channels have a sequence of lowercase characters as key and a positive integer as value. Most known sub channels should be available as typeahead completions.\n You can also drag and drop items from NEI to set the corresponding sub channel value. These items all have a tooltip of "§oIndicates§r §ovalue§r §oX§r §ofor§r §osub§r §ochannel§r §oY§r". item.structurelib.constructableTrigger.gui.info=Many multiblocks support some degree of variation in its structure and use sub channels to indicate which variant to use.\n Sub channels are has a sequence of lower case characters as key and a positive integer as value. Most known sub channels should be available as typeahead completions.\nYou can also drag and drop items from NEI to set the corresponding sub channel value. These items all have a tooltip of §oIndicates value X for sub channel Y§r.
channels.structurelib.show_errors=When set, will highlight parts of the multiblock that is definitely wrong channels.structurelib.show_errors=When set, will highlight parts of the multiblock that is definitely wrong
Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 B

After

Width:  |  Height:  |  Size: 273 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 154 B

After

Width:  |  Height:  |  Size: 279 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 B

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 160 B

After

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 B

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 B

After

Width:  |  Height:  |  Size: 281 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 141 B

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 B

After

Width:  |  Height:  |  Size: 293 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 B

After

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 139 B

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 143 B

After

Width:  |  Height:  |  Size: 297 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 B

After

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 B

After

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 B

After

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 115 B

After

Width:  |  Height:  |  Size: 281 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 276 B

After

Width:  |  Height:  |  Size: 367 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 386 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 365 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 606 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 361 B

After

Width:  |  Height:  |  Size: 439 B