-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.19 with experimental spawnproofing #27
base: 1.19
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a mod related to farming, so this feature should not including in this mod.
By the way, you can use the code replace your netherSpawnproofItems table
Method isFlammableFunction = null;
boolean isFlammable(Block block) {
boolean isFlammable = false;
try {
if (isFlammableFunction == null)
isFlammableFunction = FireBlock.class.getDeclaredMethod("isFlammable", BlockState.class);
isFlammable = (boolean) isFlammableFunction.invoke(Blocks.FIRE,
block.getDefaultState());
} catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException
| InvocationTargetException e) {
e.printStackTrace();
}
return isFlammable;
}
boolean isSpawnproofer(ItemStack itemStack) {
var block = Block.getBlockFromItem(itemStack.getItem());
// if (world.getRegistryKey() == World.NETHER) {
return (!itemStack.isEmpty()
&& (block instanceof ButtonBlock || block instanceof PressurePlateBlock || block instanceof SlabBlock)
&& !isFlammable(block));
// return (!itemStack.isEmpty()
// && netherSpawnproofItems.contains(itemStack.getItem())
// );
}
@@ -122,7 +123,7 @@ public class CropManager { | |||
FEED_MAP.put(Items.SEAGRASS, TurtleEntity.class); | |||
|
|||
// 1.14 | |||
FEED_MAP.put(Items.KELP, PandaEntity.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I does not found I feed panda with kelp XDD
@@ -203,7 +207,7 @@ public static boolean isCocoa(ItemStack stack) { | |||
&& stack.getItem() == Items.COCOA_BEANS); | |||
} | |||
|
|||
public static boolean canPaint(BlockState s, ItemStack stack) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So much wrong word!!!
This is updated for 1.19.3, latest dependencies. I've also added an experimental new feature that allows auto-spawnproofing. A number of blocks can be used: buttons, pressure plates, slabs. Not perfect - it will not place blocks on grass, etc, where mobs could still spawn.
Also fixes the bonemeal crash.