Skip to content

Commit 370a802

Browse files
committed
Decorative 4.1.1 - Bugfixes
Fixed #9 Fixed bath tires having wrong colors Update MidnightLib
1 parent 57c92db commit 370a802

File tree

6 files changed

+50
-22
lines changed

6 files changed

+50
-22
lines changed

build.gradle

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ repositories {
1717
maven { url "https://jitpack.io" }
1818
maven { url "https://maven.blamejared.com" }
1919
maven { url "https://maven.terraformersmc.com/releases" }
20+
flatDir {
21+
dirs 'local_maven'
22+
}
2023
}
2124

2225
dependencies {
@@ -36,8 +39,8 @@ dependencies {
3639
exclude module: "fabric-api"
3740
}
3841

39-
modImplementation "com.github.TeamMidnightDust:MidnightLib:${midnightlib_version}"
40-
include "com.github.TeamMidnightDust:MidnightLib:${midnightlib_version}"
42+
modImplementation "com.github.TeamMidnightDust:midnightlib:${midnightlib_version}"
43+
include "com.github.TeamMidnightDust:midnightlib:${midnightlib_version}"
4144
}
4245

4346
processResources {

gradle.properties

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ org.gradle.jvmargs=-Xmx2G
33

44
# Fabric Properties
55
# check these on https://fabricmc.net/use
6-
minecraft_version=1.17-pre1
7-
yarn_mappings=1.17-pre1+build.9
8-
loader_version=0.11.3
6+
minecraft_version=1.17
7+
yarn_mappings=1.17+build.5
8+
loader_version=0.11.3
99

1010
# Mod Properties
11-
mod_version = 4.1.0
11+
mod_version = 4.1.1
1212
maven_group = eu.midnightdust.motschen
1313
archives_base_name = decorative
1414

1515
# Dependencies
1616
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
17-
fabric_version=0.34.8+1.17
18-
mod_menu_version = 2.0.0-beta.5
19-
midnightlib_version=v0.2.2
17+
fabric_version=0.34.9+1.17
18+
mod_menu_version = 2.0.0-beta.7
19+
midnightlib_version=0.2.3
2020
patchouli_version=1.16.4-50-FABRIC

local_maven/midnightlib-0.2.3.jar

97.3 KB
Binary file not shown.

src/main/java/eu/midnightdust/motschen/decorative/block/Springboard.java

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,24 +72,28 @@ public void onPlaced(World arg, BlockPos pos, BlockState state, LivingEntity arg
7272
} else {
7373
arg.setBlockState(pos.north(), state.with(PART, Part.FRONT).with(FACING, Direction.NORTH));
7474
}
75+
break;
7576
case EAST:
7677
if (!arg.getBlockState(pos.east()).isAir()) {
7778
arg.breakBlock(pos, true);
7879
} else {
7980
arg.setBlockState(pos.east(), state.with(PART, Part.FRONT).with(FACING, Direction.EAST));
8081
}
82+
break;
8183
case SOUTH:
8284
if (!arg.getBlockState(pos.south()).isAir()) {
8385
arg.breakBlock(pos, true);
8486
} else {
8587
arg.setBlockState(pos.south(), state.with(PART, Part.FRONT).with(FACING, Direction.SOUTH));
8688
}
89+
break;
8790
case WEST:
8891
if (!arg.getBlockState(pos.west()).isAir()) {
8992
arg.breakBlock(pos, true);
9093
} else {
9194
arg.setBlockState(pos.west(), state.with(PART, Part.FRONT).with(FACING, Direction.WEST));
9295
}
96+
break;
9397
}
9498
}
9599
}
@@ -98,23 +102,47 @@ public void onBreak(World world, BlockPos pos, BlockState state, PlayerEntity pl
98102
switch (state.get(PART)) {
99103
case BACK: switch (state.get(FACING)) {
100104
case NORTH:
101-
if (world.getBlockState(pos.north()).contains(PART)) { world.breakBlock(pos.north(), true);}
105+
if (world.getBlockState(pos.north()).contains(PART)) {
106+
world.breakBlock(pos.north(), true);
107+
break;
108+
}
102109
case EAST:
103-
if (world.getBlockState(pos.east()).contains(PART)) { world.breakBlock(pos.east(), true);}
110+
if (world.getBlockState(pos.east()).contains(PART)) {
111+
world.breakBlock(pos.east(), true);
112+
break;
113+
}
104114
case SOUTH:
105-
if (world.getBlockState(pos.south()).contains(PART)) { world.breakBlock(pos.south(), true);}
115+
if (world.getBlockState(pos.south()).contains(PART)) {
116+
world.breakBlock(pos.south(), true);
117+
break;
118+
}
106119
case WEST:
107-
if (world.getBlockState(pos.west()).contains(PART)) { world.breakBlock(pos.west(), true);}
120+
if (world.getBlockState(pos.west()).contains(PART)) {
121+
world.breakBlock(pos.west(), true);
122+
break;
123+
}
108124
}
109125
case FRONT: switch (state.get(FACING)) {
110126
case NORTH:
111-
if (world.getBlockState(pos.south()).contains(PART)) { world.breakBlock(pos.south(), true); }
127+
if (world.getBlockState(pos.south()).contains(PART)) {
128+
world.breakBlock(pos.south(), true);
129+
break;
130+
}
112131
case EAST:
113-
if (world.getBlockState(pos.west()).contains(PART)) { world.breakBlock(pos.south(), true); }
132+
if (world.getBlockState(pos.west()).contains(PART)) {
133+
world.breakBlock(pos.west(), true);
134+
break;
135+
}
114136
case SOUTH:
115-
if (world.getBlockState(pos.north()).contains(PART)) { world.breakBlock(pos.south(), true); }
137+
if (world.getBlockState(pos.north()).contains(PART)) {
138+
world.breakBlock(pos.north(), true);
139+
break;
140+
}
116141
case WEST:
117-
if (world.getBlockState(pos.east()).contains(PART)) { world.breakBlock(pos.south(), true); }
142+
if (world.getBlockState(pos.east()).contains(PART)) {
143+
world.breakBlock(pos.east(), true);
144+
break;
145+
}
118146
}
119147
}
120148
}
@@ -213,7 +241,7 @@ private static VoxelShape rotate(Direction from, Direction to, VoxelShape shape)
213241
}
214242

215243
public boolean canPlaceAt(BlockState state, WorldView worldView, BlockPos pos) {
216-
return !worldView.isAir(pos.down());
244+
return !worldView.isAir(pos.down()) && worldView.getBlockState(pos.offset(state.get(FACING))) == Blocks.AIR.getDefaultState();
217245
}
218246

219247
}

src/main/java/eu/midnightdust/motschen/decorative/entity/client/renderer/BathTireRenderer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
@Environment(EnvType.CLIENT)
1313
public class BathTireRenderer extends MobEntityRenderer<BathTireEntity, BathTireModel> {
14-
private static Identifier TEXTURE;
14+
private final Identifier TEXTURE;
1515
public BathTireRenderer(EntityRendererFactory.Context context, DyeColor color) {
1616
super(context, new BathTireModel(context.getPart(BathTireModel.BATH_TIRE_MODEL_LAYER)), 0.5F);
1717
TEXTURE = Identifier.tryParse("textures/block/"+color.getName()+"_concrete.png");

src/main/resources/fabric.mod.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@
2525
],
2626
"client": [
2727
"eu.midnightdust.motschen.decorative.DecorativeClient"
28-
],
29-
"modmenu": [
30-
"eu.midnightdust.motschen.decorative.config.ModMenuIntegration"
3128
]
3229
},
3330

0 commit comments

Comments
 (0)