Skip to content

Commit

Permalink
change: rename some blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Zepalesque committed Jun 11, 2024
1 parent 35b3c33 commit 7d1dba4
Show file tree
Hide file tree
Showing 15 changed files with 26 additions and 38 deletions.
9 changes: 4 additions & 5 deletions src/main/java/net/zepalesque/redux/block/ReduxBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import net.neoforged.neoforge.registries.DeferredBlock;
import net.neoforged.neoforge.registries.DeferredRegister;
import net.zepalesque.redux.Redux;
import net.zepalesque.redux.block.construction.BaseLitBlock;
import net.zepalesque.redux.block.dungeon.DoorwayPillarBlock;
import net.zepalesque.redux.block.dungeon.RunelightBlock;
import net.zepalesque.redux.block.dungeon.TrappedPillarBlock;
Expand Down Expand Up @@ -71,8 +70,8 @@ public class ReduxBlocks extends ReduxBlockBuilders {

public static final DeferredBlock<Block> RUNELIGHT = register("runelight", () ->
new RunelightBlock(Properties.of()
.mapColor(state -> state.getValue(BaseLitBlock.LIT) ? MapColor.COLOR_LIGHT_BLUE : MapColor.LAPIS)
.lightLevel(state -> state.getValue(BaseLitBlock.LIT) ? 13 : 1)
.mapColor(state -> state.getValue(RunelightBlock.LIT) ? MapColor.COLOR_LIGHT_BLUE : MapColor.LAPIS)
.lightLevel(state -> state.getValue(RunelightBlock.LIT) ? 13 : 1)
.strength(0.7F, 6.0F)
.sound(SoundType.COPPER_BULB)
.requiresCorrectToolForDrops()
Expand All @@ -82,8 +81,8 @@ public class ReduxBlocks extends ReduxBlockBuilders {

public static final DeferredBlock<Block> LOCKED_RUNELIGHT = register("locked_runelight", () ->
new RunelightBlock(Properties.of()
.mapColor(state -> state.getValue(BaseLitBlock.LIT) ? MapColor.COLOR_LIGHT_BLUE : MapColor.LAPIS)
.lightLevel(state -> state.getValue(BaseLitBlock.LIT) ? 13 : 1)
.mapColor(state -> state.getValue(RunelightBlock.LIT) ? MapColor.COLOR_LIGHT_BLUE : MapColor.LAPIS)
.lightLevel(state -> state.getValue(RunelightBlock.LIT) ? 13 : 1)
.strength(-1.0F, 3600000.0F)
.sound(SoundType.COPPER_BULB)
.instrument(NoteBlockInstrument.IRON_XYLOPHONE),
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,23 @@
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.level.gameevent.GameEvent;
import net.minecraft.world.phys.BlockHitResult;
import net.zepalesque.redux.block.construction.BaseLitBlock;

public class RunelightBlock extends BaseLitBlock {
public class RunelightBlock extends Block {
public static final BooleanProperty LIT = BlockStateProperties.LIT;

protected final boolean creativeInteractOnly;

public RunelightBlock(Properties properties, boolean creativeInteractOnly) {
super(properties);
this.creativeInteractOnly = creativeInteractOnly;
this.registerDefaultState(this.getStateDefinition().any().setValue(LIT, true));
}

@Override
Expand All @@ -37,4 +43,10 @@ public InteractionResult use(BlockState state, Level level, BlockPos pos, Player
public boolean isValidForInteraction(Player player) {
return !this.creativeInteractOnly || player.getAbilities().instabuild;
}

@Override
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
super.createBlockStateDefinition(builder);
builder.add(LIT);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
public class ReduxStoneSets {

public static final BaseStoneSet SENTRITE = register(new BaseStoneSet("sentrite", MapColor.DEEPSLATE, SoundType.NETHER_ORE, 1.0F, 6.0F, "natural/",
"A dark rock found in the Aether. A mixture of this and holystone is what makes up the walls of the Bronze Dungeon.")).craftsInto(AetherBlocks.CARVED_STONE,
"A dark, metallic rock found throughout the Aether. This crude metal is used in a number of parts of Sentry technology, even their walls of Carved Stone are made of a mixture of this and Holystone.")).craftsInto(AetherBlocks.CARVED_STONE,
new CraftingMatrix(4, builder ->
builder
.define('H', AetherBlocks.HOLYSTONE.get())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ public static <T extends AbstractBookshelfSet<?>> T register(T set) {
return set;
}

public static void init() {}
public static void init() {
// Manually load class
}
}
2 changes: 1 addition & 1 deletion src/main/java/net/zepalesque/redux/config/ReduxConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public Common(ModConfigSpec.Builder builder) {
builder.push("TODO");
bronze_dungeon_upgrade = builder
.comment("Upgrades the Bronze Dungeon structure with new blocks and more depth")
.define("Revamped Quicksoil Movement", true);
.define("Bronze Dungeon Upgrade", true);
builder.pop();
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
package net.zepalesque.redux.data.prov;

import com.aetherteam.aether.Aether;
import com.aetherteam.aether.block.dungeon.DoorwayBlock;
import com.aetherteam.aether.data.providers.AetherBlockStateProvider;
import net.minecraft.core.Direction;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.data.PackOutput;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.ItemDisplayContext;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.RotatedPillarBlock;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.block.state.properties.IntegerProperty;
import net.neoforged.neoforge.client.model.generators.BlockModelBuilder;
Expand All @@ -19,8 +16,8 @@
import net.neoforged.neoforge.client.model.generators.ModelProvider;
import net.neoforged.neoforge.common.data.ExistingFileHelper;
import net.zepalesque.redux.Redux;
import net.zepalesque.redux.block.construction.BaseLitBlock;
import net.zepalesque.redux.block.construction.LayeredBookshelfBlock;
import net.zepalesque.redux.block.dungeon.RunelightBlock;
import net.zepalesque.redux.block.natural.AetherShortGrassBlock;
import net.zepalesque.redux.block.state.ReduxStates;

Expand Down Expand Up @@ -169,8 +166,8 @@ public void cubeActivatable(Block block, Block other, String location) {
ModelFile off = this.models().cubeAll(this.name(other), this.texture(this.name(other), location));
ModelFile on = this.models().cubeAll(this.name(other) + "_on", this.texture(this.name(other) + "_on", location));
this.getVariantBuilder(block)
.partialState().with(BaseLitBlock.LIT, true).modelForState().modelFile(on).addModel()
.partialState().with(BaseLitBlock.LIT, false).modelForState().modelFile(off).addModel();
.partialState().with(RunelightBlock.LIT, true).modelForState().modelFile(on).addModel()
.partialState().with(RunelightBlock.LIT, false).modelForState().modelFile(off).addModel();
}

public void dungeonBlock(Block block, Block baseBlock, String location) {
Expand Down

0 comments on commit 7d1dba4

Please sign in to comment.