Skip to content

Commit

Permalink
1.20.1-1.12.7 release with breaker target fix and hopper hardness
Browse files Browse the repository at this point in the history
  • Loading branch information
Lothrazar committed Mar 9, 2024
1 parent 963c861 commit 30c7dd2
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 7 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ org.gradle.daemon=false

mod_id=cyclic
curse_id=239286
mod_version=1.12.6
mod_version=1.12.7

# NEO FORGED
forge_version=47.1.65
Expand Down
25 changes: 22 additions & 3 deletions src/main/java/com/lothrazar/cyclic/block/breaker/TileBreaker.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;

public class TileBreaker extends TileBlockEntityCyclic implements MenuProvider {

Expand Down Expand Up @@ -44,14 +45,32 @@ public void tick() {
return;
}
BlockPos target = worldPosition.relative(this.getCurrentFacing());
BlockState state = level.getBlockState(target);
if (!state.isAir() &&
state.getDestroySpeed(level, target) >= 0) {
if (this.isValid(target)) {
//old way would pass thru here and try to mine minecraft:water
this.level.destroyBlock(target, true);
}
//else unbreakable
}

/**
* Avoid mining source liquid blocks and unbreakable
*/
private boolean isValid(BlockPos target) {
BlockState state = level.getBlockState(target);
if (level.isEmptyBlock(target)
&& state.getDestroySpeed(level, target) >= 0) {
return false;
}
if (state.getFluidState() != null && state.getFluidState().isEmpty() == false) {
//am i a solid waterlogged state block?
if (state.hasProperty(BlockStateProperties.WATERLOGGED) == false) {
//pure liquid. but this will make canHarvestBlock go true
return false;
}
}
return true;
}

@Override
public Component getDisplayName() {
return BlockRegistry.BREAKER.get().getName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class BlockSimpleHopper extends BlockCyclic {
public static final DirectionProperty FACING = BlockStateProperties.FACING_HOPPER;

public BlockSimpleHopper(Properties properties) {
super(properties.strength(1.3F));
super(properties.strength(2.0F, 3.0F));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
public class BlockGoldHopper extends BlockSimpleHopper {

public BlockGoldHopper(Properties properties) {
super(properties.strength(1.3F));
super(properties);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"cyclic:hopper"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"replace": false,
"values": [
"cyclic:compressed_cobblestone",
"cyclic:flint_block"
"cyclic:flint_block",
"cyclic:hopper_gold",
"cyclic:hopper"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"replace": false,
"values": [
"cyclic:soil",
"cyclic:terra_preta",
"cyclic:peat_baked",
"cyclic:peat_unbaked"
]
Expand Down
1 change: 1 addition & 0 deletions update.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,5 +161,6 @@
,"1.20.4": "Remove eating cooldown on some foods. Glistering Chorus Fruit is now stackable again like before (potion time +stacks up #2309). CraftTweaker zenscript support added to the 5 cyclic recipe types, see scripts folder in this link for examples https://github.com/Lothrazar/Cyclic/tree/trunk/1.20/examples "
,"1.20.5":"Merge pull request #2334 from TelepathicGrunt/trunk/1.20 Optimize anti beacon to not deadlock worldgen or lag entities"
,"1.20.6":"#2332 Patch doorbell crash. Patch InvocationTargetException: null errors coming from IHasClickToggle"
,"1.20.7":"Change curio render_toggle. #2356. Wooden Hopper is mineable with axes. Fixed Block Breaker attempting to break liquid source blocks. "
}
}

0 comments on commit 30c7dd2

Please sign in to comment.