-
Notifications
You must be signed in to change notification settings - Fork 11
New Functionality For Block Respawning #222
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
base: 1.20.1
Are you sure you want to change the base?
Conversation
For respawning config and helper methods in respawn logic
Added functionality to tick() for block respawning if enabled
|
Two things.
|
|
Sorry for the wait, is it better now? |
|
Def better. gonna review now |
|
Has this been tested with the feature disabled? |
| this.setFlags(EnumSet.of(Flag.LOOK, Flag.MOVE)); | ||
| } | ||
|
|
||
|
|
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.
Why all those empty lines between methods?
| import java.util.List; | ||
|
|
||
| public class MineTowardsTargetGoal extends Goal { | ||
| import static insane96mcp.enhancedai.modules.mobs.miner.MinerMobs.blacklistTileEntities; |
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.
Why this static import?
| if (this.miner.hasEffect(MobEffects.DIG_SLOWDOWN)) { | ||
| //noinspection ConstantConditions | ||
| float miningFatigueAmplifier = switch (this.miner.getEffect(MobEffects.DIG_SLOWDOWN).getAmplifier()) { | ||
| float f = switch (this.miner.getEffect(MobEffects.DIG_SLOWDOWN).getAmplifier()) { |
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.
Why not keep the correct name?
| SCALE_RESPAWN_BY_HARDNESS = EAIData.ofBool(this.createDataKey("scale_respawn_by_hardness")); | ||
| BASE_RESPAWN_TIME = EAIData.ofInt(this.createDataKey("base_respawn_time")); | ||
| HARDNESS_RESPAWN_MULTIPLIER = EAIData.ofDouble(this.createDataKey("hardness_respawn_multiplier")); | ||
| net.minecraftforge.common.MinecraftForge.EVENT_BUS.register(MineTowardsTargetGoal.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.
What's this for?
| return data; | ||
| } | ||
|
|
||
|
|
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.
Just leave one empty line between methods
Features added:
option for blocks to respawn at a configurable time
option for the respawn time to scale with hardness
respawn saves and respawn tile entities (saves nbt only if its a tile entity)
respawn drops/pushes out any blocks that obstruct the space of a respawning block
spawning is persistent across world load