Skip to content

Commit

Permalink
refactor: little thing
Browse files Browse the repository at this point in the history
  • Loading branch information
Zepalesque committed Jan 1, 2025
1 parent 72f37ec commit 45362df
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ org.gradle.debug=false


# Version
mod_version=1.2.04
mod_version=1.2.05

# Mod
mod_id=zenith
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,25 @@
import java.util.function.Supplier;

public class ZenithHangingSignBlockEntity extends HangingSignBlockEntity {
protected final AbstractWoodSet woodset;
protected final Supplier<BlockEntityType<? extends ZenithHangingSignBlockEntity>> typeSupplier;

protected <T extends AbstractWoodSet> ZenithHangingSignBlockEntity(BlockPos pos, BlockState state, T woodset) {
protected ZenithHangingSignBlockEntity(BlockPos pos, BlockState state, Supplier<BlockEntityType<? extends ZenithHangingSignBlockEntity>> typeSupplier) {
super(pos, state);
this.woodset = woodset;
this.typeSupplier = typeSupplier;
}

// Fix to get around crashing caused by the validateBlockState method
public static <T extends AbstractWoodSet> ZenithHangingSignBlockEntity create(BlockPos pos, BlockState state, T set) {
public static ZenithHangingSignBlockEntity create(BlockPos pos, BlockState state, Supplier<BlockEntityType<? extends ZenithHangingSignBlockEntity>> set) {
return new ZenithHangingSignBlockEntity(pos, state, set) {
@Override
public BlockEntityType<? extends ZenithHangingSignBlockEntity> getType() {
return this.woodset == null ? set.hangingSignEntity().get() : this.woodset.hangingSignEntity().get();
return this.typeSupplier == null ? set.get() : this.typeSupplier.get();
}
};
}

@Override
public BlockEntityType<? extends ZenithHangingSignBlockEntity> getType() {
return this.woodset.hangingSignEntity().get();
return this.typeSupplier.get();
}
}

0 comments on commit 45362df

Please sign in to comment.