Safer Endest Pearls (#71)

This commit is contained in:
Nikolay S. authored and GitHub committed 2026-01-27 10:56:09 -05:00
1 parent 3c098fe87b
commit c980b36e91
10 files changed
+104 -66

No files matched your search

+30 -3
View File
@@ -39,9 +39,33 @@ remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/co
# `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE.
developmentEnvironmentUserName = Developer
# Enables using modern Java syntax (up to version 17) via Jabel, while still targeting JVM 8.
# See https://github.com/bsideup/jabel for details on how this works.
enableModernJavaSyntax = true
# Enables modern Java syntax support. Valid values:
# - false: No modern syntax, Java 8 only
# - jabel: Jabel syntax-only support, compiles to J8 bytecode
# - jvmDowngrader: Full modern Java via JVM Downgrader (syntax + stdlib APIs)
# - modern: Native modern Java bytecode, no downgrading
enableModernJavaSyntax = jabel
# 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
# Target JVM version for JVM Downgrader bytecode downgrading.
# Only used when enableModernJavaSyntax = jvmDowngrader
# downgradeTargetVersion = 8
# Comma-separated list of Java versions for multi-release jar support (JVM Downgrader only).
# Classes will be available in META-INF/versions/N/ for each version N in this list.
# Default: "21,25" (J25+ gets native classes, J21-24 gets partial downgrade, J8-20 gets full downgrade).
# jvmDowngraderMultiReleaseVersions = 21,25
# Specifies how JVM Downgrader API stubs are provided. Options:
# - shade: Shade minimized stubs into the jar
# - gtnhlib: GTNHLib provides stubs at runtime (adds version constraint)
# - external: Another dependency provides stubs (no constraint, no warning)
# - (empty): Warning reminding you to configure stubs
# Note: 'shade' option requires you to verify license compliance, see: https://github.com/unimined/JvmDowngrader/blob/main/LICENSE.md
# jvmDowngraderStubsProvider =
# 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.
@@ -209,3 +233,6 @@ curseForgeRelations =
# This is meant to be set in $HOME/.gradle/gradle.properties.
# ideaCheckSpotlessOnBuild = true
# Non-GTNH properties
org.gradle.configuration-cache = true
org.gradle.parallel = true
+12
View File
@@ -0,0 +1,12 @@
#This file is generated by updateDaemonJvm
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/fd88a209e0f18ca6eaf97d9fa9e45e01/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/fd88a209e0f18ca6eaf97d9fa9e45e01/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/7799fb2cb9f9eb382df2b8b6fb793b77/redirect
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/99a42fd36e2e41c7c8ed49f423f49fdf/redirect
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/fd88a209e0f18ca6eaf97d9fa9e45e01/redirect
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/93aeea858331bd6bb00ba94759830234/redirect
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/3087f28f30be41ab6818c16a488f5f8a/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
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Vendored
+1 -4
View File
@@ -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="\\\"\\\""
# 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,7 +210,6 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"
Vendored
+1 -2
View File
@@ -70,11 +70,10 @@ goto fail
:execute
@rem Setup the command line
set CLASSPATH=
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
"%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
+1 -1
View File
@@ -17,7 +17,7 @@ pluginManagement {
}
plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.48'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.18'
}
@@ -12,6 +12,8 @@ public class Config {
public static boolean endStone = true;
public static boolean bedrockBreaker = true;
public static boolean boringFood = false;
public static boolean endestGriefing = true;
public static boolean endestTileGriefing = true;
public static boolean fractured = false;
public static boolean fast = true;
public static boolean stepUp = true;
@@ -81,6 +83,19 @@ public class Config {
boringFood,
"Enable to keep the Ultimate Stew and Cosmic Meatballs from grabbing more ingredients")
.getBoolean(false);
endestGriefing = conf
.get(
"general",
"Endest Pearl Griefing",
endestGriefing,
"When enabled, the endest pearl will destroy blocks around the location it hits.")
.getBoolean();
endestTileGriefing = conf.get(
"general",
"Endest Pearl Tile-Entity Griefing",
endestTileGriefing,
"When disabled, the Endest Pearl will never break any tile entities, no matter their blast resistance.")
.getBoolean();
fractured = conf
.get(
"general",
@@ -158,5 +173,4 @@ public class Config {
conf.save();
}
}
}
@@ -1,7 +1,7 @@
package fox.spiteful.avaritia.compat.botania;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
@@ -67,8 +67,10 @@ public class PageLudicrousRecipe extends PageRecipe {
if (shapelessRecipe) {
((GuiScreen) gui).drawTexturedModalRect(iconX, iconY, 240, 0, 16, 16);
if (mx >= iconX && my >= iconY && mx < iconX + 16 && my < iconY + 16) RenderHelper
.renderTooltip(mx, my, Arrays.asList(StatCollector.translateToLocal("botaniamisc.shapeless")));
if (mx >= iconX && my >= iconY && mx < iconX + 16 && my < iconY + 16) RenderHelper.renderTooltip(
mx,
my,
Collections.singletonList(StatCollector.translateToLocal("botaniamisc.shapeless")));
iconY += 20;
}
@@ -79,8 +81,10 @@ public class PageLudicrousRecipe extends PageRecipe {
if (oreDictRecipe) {
((GuiScreen) gui).drawTexturedModalRect(iconX, iconY, 240, 16, 16, 16);
if (mx >= iconX && my >= iconY && mx < iconX + 16 && my < iconY + 16) RenderHelper
.renderTooltip(mx, my, Arrays.asList(StatCollector.translateToLocal("botaniamisc.oredict")));
if (mx >= iconX && my >= iconY && mx < iconX + 16 && my < iconY + 16) RenderHelper.renderTooltip(
mx,
my,
Collections.singletonList(StatCollector.translateToLocal("botaniamisc.oredict")));
}
GL11.glDisable(GL11.GL_BLEND);
}
@@ -94,8 +98,7 @@ public class PageLudicrousRecipe extends PageRecipe {
}
public void renderCraftingRecipe(IGuiLexiconEntry gui, IRecipe recipe) {
if (recipe instanceof ExtremeShapedRecipe) {
ExtremeShapedRecipe shaped = (ExtremeShapedRecipe) recipe;
if (recipe instanceof ExtremeShapedRecipe shaped) {
for (int y = 0; y < shaped.recipeHeight; y++) for (int x = 0; x < shaped.recipeWidth; x++)
renderItemAtLudicrousGridPos(gui, x, y, shaped.recipeItems[y * shaped.recipeWidth + x], true);
@@ -103,8 +106,7 @@ public class PageLudicrousRecipe extends PageRecipe {
oreDictRecipe = true;
} else if (recipe instanceof ExtremeShapelessRecipe) {
shapelessRecipe = true;
} else if (recipe instanceof ShapelessOreRecipe) {
ShapelessOreRecipe shapeless = (ShapelessOreRecipe) recipe;
} else if (recipe instanceof ShapelessOreRecipe shapeless) {
drawGrid: {
for (int y = 0; y < 3; y++) for (int x = 0; x < 3; x++) {
@@ -3,7 +3,6 @@ package fox.spiteful.avaritia.entity;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.command.IEntitySelector;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@@ -11,52 +10,17 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.util.Vec3;
import net.minecraft.world.Explosion;
import net.minecraft.world.World;
import fox.spiteful.avaritia.Config;
public class EntityGapingVoid extends Entity {
public static final int maxLifetime = 186;
public static double collapse = .95;
public static double suckrange = 20.0;
public static final IEntitySelector sucklector = new IEntitySelector() {
@Override
public boolean isEntityApplicable(Entity ent) {
if (ent instanceof EntityPlayer) {
EntityPlayer p = (EntityPlayer) ent;
if (p.capabilities.isCreativeMode && p.capabilities.isFlying) {
return false;
}
}
return true;
}
};
public static final IEntitySelector nomlector = new IEntitySelector() {
@Override
public boolean isEntityApplicable(Entity ent) {
if (!(ent instanceof EntityLivingBase)) {
return false;
}
if (ent instanceof EntityPlayer) {
EntityPlayer p = (EntityPlayer) ent;
if (p.capabilities.isCreativeMode) {
return false;
}
} else if (ent instanceof EntityImmortalItem) {
return false;
}
return true;
}
};
public EntityGapingVoid(World world) {
super(world);
this.isImmuneToFire = true;
@@ -120,7 +84,10 @@ public class EntityGapingVoid extends Entity {
this.posX + suckrange,
this.posY + suckrange,
this.posZ + suckrange);
List<Entity> sucked = this.worldObj.selectEntitiesWithinAABB(Entity.class, suckzone, sucklector);
List<Entity> sucked = this.worldObj.selectEntitiesWithinAABB(
Entity.class,
suckzone,
ent -> !(ent instanceof EntityPlayer p && p.capabilities.isCreativeMode && p.capabilities.isFlying));
double radius = getVoidScale(age) * 0.5;
@@ -145,6 +112,8 @@ public class EntityGapingVoid extends Entity {
}
}
if (this.worldObj.isRemote) return;
// om nom nom
double nomrange = radius * 0.95;
AxisAlignedBB nomzone = AxisAlignedBB.getBoundingBox(
@@ -154,8 +123,18 @@ public class EntityGapingVoid extends Entity {
this.posX + nomrange,
this.posY + nomrange,
this.posZ + nomrange);
List<EntityLivingBase> nommed = this.worldObj
.selectEntitiesWithinAABB(EntityLivingBase.class, nomzone, nomlector);
List<EntityLivingBase> nommed = this.worldObj.selectEntitiesWithinAABB(EntityLivingBase.class, nomzone, ent -> {
if (!(ent instanceof EntityLivingBase)) {
return false;
}
if (ent instanceof EntityPlayer p) {
return !p.capabilities.isCreativeMode;
}
return true;
});
for (EntityLivingBase nommee : nommed) {
double dx = this.posX - nommee.posX;
@@ -171,7 +150,7 @@ public class EntityGapingVoid extends Entity {
}
// every half second, SMASH STUFF
if (age % 10 == 0) {
if (Config.endestGriefing && age % 10 == 0) {
int bx = (int) Math.floor(this.posX);
int by = (int) Math.floor(this.posY);
int bz = (int) Math.floor(this.posZ);
@@ -194,6 +173,11 @@ public class EntityGapingVoid extends Entity {
if (dist <= nomrange && !this.worldObj.isAirBlock(lx, ly, lz)) {
Block b = this.worldObj.getBlock(lx, ly, lz);
int meta = this.worldObj.getBlockMetadata(lx, ly, lz);
if (!Config.endestTileGriefing && this.worldObj.getTileEntity(lx, ly, lz) != null) {
continue;
}
float resist = b.getExplosionResistance(
this,
this.worldObj,
@@ -203,6 +187,7 @@ public class EntityGapingVoid extends Entity {
this.posX,
this.posY,
this.posZ);
if (resist <= 10.0) {
b.dropBlockAsItemWithChance(worldObj, lx, ly, lz, meta, 0.9f, 0);
this.worldObj.setBlockToAir(lx, ly, lz);
@@ -255,7 +240,9 @@ public class EntityGapingVoid extends Entity {
}
@Override
public boolean canBeCollidedWith() {
return false;
public boolean func_145774_a(Explosion explosionIn, World worldIn, int x, int y, int z, Block blockIn,
float unused) {
// Can the final explosion break this block?
return Config.endestGriefing && (Config.endestTileGriefing || worldIn.getTileEntity(x, y, z) == null);
}
}