Skip to content

Commit

Permalink
fix: fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Zepalesque committed May 25, 2024
1 parent 8fa23e2 commit 9cbedf1
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 17 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ aether_version=1.20.4-1.4.1-neoforge
nitrogen_version=1.20.4-1.1.4-neoforge
cumulus_version=1.20.4-1.0.1-neoforge
curios_version=7.3.4
zenith_version=1.0.12
zenith_version=1.0.13
aeroblender_version=5271794
terrablender_version=1.20.4-3.3.0.12
terrablender_version_minimum=1.20.4-3.3.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,20 @@ protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockSt
protected void fixShapeMaps() {
WallBlockAccessor wallBlockAccessor = (WallBlockAccessor) this;
Map<BlockState, VoxelShape> shapeByIndex = wallBlockAccessor.redux$getShapeByIndex();
shapeByIndex = fixShapeMap(shapeByIndex).build();
shapeByIndex = fixShapeMap(shapeByIndex);
wallBlockAccessor.redux$setShapeByIndex(shapeByIndex);

Map<BlockState, VoxelShape> collisionShapeByIndex = wallBlockAccessor.redux$getCollisionShapeByIndex();
collisionShapeByIndex = fixShapeMap(collisionShapeByIndex).build();
collisionShapeByIndex = fixShapeMap(collisionShapeByIndex);
wallBlockAccessor.redux$setCollisionShapeByIndex(collisionShapeByIndex);
}

protected ImmutableMap.Builder<BlockState, VoxelShape> fixShapeMap(Map<BlockState, VoxelShape> map) {
protected ImmutableMap<BlockState, VoxelShape> fixShapeMap(Map<BlockState, VoxelShape> map) {
ImmutableMap.Builder<BlockState, VoxelShape> builder = ImmutableMap.builder();
builder.putAll(map);
for (BlockState state : map.keySet()) {
builder.put(state.cycle(AetherBlockStateProperties.DOUBLE_DROPS), map.get(state));
}
return builder;
return builder.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,36 @@
import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.phys.shapes.VoxelShape;
import net.zepalesque.redux.block.state.ReduxStates;
import net.zepalesque.redux.mixin.mixins.common.accessor.WallBlockAccessor;

import java.util.Map;

public class ReduxNaturalWall extends ReduxDoubleDropsWall {
public ReduxNaturalWall(Properties properties) {
super(properties);
this.registerDefaultState(this.defaultBlockState().setValue(ReduxStates.NATURAL_GEN, false));
this.fixShapeMaps();
this.fixShapeMaps2();
}

@Override
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
super.createBlockStateDefinition(builder);
builder.add(ReduxStates.NATURAL_GEN);

private void fixShapeMaps2() {
WallBlockAccessor accessor = (WallBlockAccessor) this;
Map<BlockState, VoxelShape> shapeByIndex = accessor.redux$getShapeByIndex();
shapeByIndex = fixShapeMap2(shapeByIndex);
accessor.redux$setShapeByIndex(shapeByIndex);

Map<BlockState, VoxelShape> collisionShapeByIndex = accessor.redux$getCollisionShapeByIndex();
collisionShapeByIndex = fixShapeMap2(collisionShapeByIndex);
accessor.redux$setCollisionShapeByIndex(collisionShapeByIndex);
}

@Override
protected ImmutableMap.Builder<BlockState, VoxelShape> fixShapeMap(Map<BlockState, VoxelShape> map) {
ImmutableMap.Builder<BlockState, VoxelShape> builder = super.fixShapeMap(map);
private static Map<BlockState, VoxelShape> fixShapeMap2(Map<BlockState, VoxelShape> map) {
ImmutableMap.Builder<BlockState, VoxelShape> builder = ImmutableMap.builder();
builder.putAll(map);
for (BlockState state : map.keySet()) {
builder.put(state.cycle(ReduxStates.NATURAL_GEN), map.get(state));
}
return builder;
return builder.build();
}

}
9 changes: 6 additions & 3 deletions src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ version="${mod_version}"
displayName="${mod_name}"
displayURL = "https://github.com/Zepalesque/The-Aether-Redux"
logoFile = "redux.png"
credits = "The Aether Team, Aerod, BrianIsBro, Emile van Kreiken, 345boneshoss, RazorDevs, unroman, Parallel113, IcyCrystal, ModdingLegacy, Builderdog841, Jonathing, LlamaLad7, Shimmer.shine"
authors = "Zepalesque"
description = '''
Zenith is a library designed to simplify a variety of tedious processes in a way that is dynamic and easily expandable, along with adding useful APIs that can be used for mods.
The main reason the mod exists is for the Aether: Redux, but it may be used in the future, and may be useful as well.
The Aether: Redux is an expansive addon mod for the well-known Aether mod, adding a wide variety of new content ranging from several new biomes to an overhaul to the mod's first dungeon. There are a variety of other new features as well! \n\nA whole lot of new mob models have also been implemented, which are all configurable as well, so you can choose between Redux's upgraded versions and the originals if you prefer them. \n\nYou can also configure Redux's built-in asset overrides resource pack, using the new in-game config system created specifically for this, so you can change the appearance of various parts of the mod to your hearts content! \n\nSpeaking of configuration, the mod also has a ton of configuration options, so check those out, as you could very well prefer certain options over others.
'''

[[mixins]]
config="${mod_id}.mixins.json"

[[dependencies.aether_redux]] #optional
modId="neoforge" #mandatory
type="required" #mandatory
Expand Down

0 comments on commit 9cbedf1

Please sign in to comment.