-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
6 changed files
with
19 additions
and
32 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
src/main/java/dev/schmarrn/schnowy/common/blocks/SchnowyBlockInterface.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,18 @@ | ||
package dev.schmarrn.schnowy.common.blocks; | ||
|
||
import dev.schmarrn.schnowy.mixin.BlockPropertiesMixin; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.world.level.LevelReader; | ||
import net.minecraft.world.level.block.state.BlockBehaviour; | ||
|
||
public interface SchnowyBlockInterface { | ||
/** | ||
* @return whether the block can currently be snow logged | ||
*/ | ||
boolean canLog(LevelReader level, BlockPos pos); | ||
|
||
static BlockBehaviour.Properties notReplaceableHack(BlockBehaviour.Properties properties) { | ||
((BlockPropertiesMixin) properties).setReplaceable(false); | ||
return properties; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 0 additions & 7 deletions
7
src/main/java/dev/schmarrn/schnowy/common/duck/BlockPropertiesDuck.java
This file was deleted.
Oops, something went wrong.
15 changes: 4 additions & 11 deletions
15
src/main/java/dev/schmarrn/schnowy/mixin/BlockPropertiesMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,11 @@ | ||
package dev.schmarrn.schnowy.mixin; | ||
|
||
import dev.schmarrn.schnowy.common.duck.BlockPropertiesDuck; | ||
import net.minecraft.world.level.block.state.BlockBehaviour; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.gen.Accessor; | ||
|
||
@Mixin(BlockBehaviour.Properties.class) | ||
public class BlockPropertiesMixin implements BlockPropertiesDuck { | ||
@Shadow | ||
boolean replaceable; | ||
|
||
@Override | ||
public BlockBehaviour.Properties nonReplaceable() { | ||
this.replaceable = false; | ||
return (BlockBehaviour.Properties) (Object) this; | ||
} | ||
public interface BlockPropertiesMixin { | ||
@Accessor("replaceable") | ||
void setReplaceable(boolean bla); | ||
} |