Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Commit d4c8b53

Browse files
NuclearfartsNuclearfarts
authored andcommitted
changes from PR review
1 parent eb5a189 commit d4c8b53

File tree

4 files changed

+45
-10
lines changed

4 files changed

+45
-10
lines changed

patchwork-extensions-block/src/main/java/net/minecraftforge/common/extensions/IForgeBlock.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ default boolean removedByPlayer(BlockState state, World world, BlockPos pos, Pla
250250
* @return True to treat this as a bed
251251
*/
252252
default boolean isBed(BlockState state, BlockView world, BlockPos pos, @Nullable Entity player) {
253-
return this.getBlock() instanceof BedBlock;
253+
return false;
254254
}
255255

256256
//TODO Call locations: Patches: SpawnHelper*
@@ -826,18 +826,18 @@ default float[] getBeaconColorMultiplier(BlockState state, CollisionView world,
826826
@Environment(EnvType.CLIENT)
827827
default Vec3d getFogColor(BlockState state, CollisionView world, BlockPos pos, Entity entity, Vec3d originalColor, float partialTicks) {
828828
if (state.getMaterial() == Material.WATER) {
829-
float f12 = 0.0F;
829+
float visibility = 0.0F;
830830

831831
if (entity instanceof LivingEntity) {
832832
LivingEntity ent = (LivingEntity) entity;
833-
f12 = (float) EnchantmentHelper.getRespiration(ent) * 0.2F;
833+
visibility = (float) EnchantmentHelper.getRespiration(ent) * 0.2F;
834834

835835
if (ent.hasStatusEffect(StatusEffects.WATER_BREATHING)) {
836-
f12 = f12 * 0.3F + 0.6F;
836+
visibility = visibility * 0.3F + 0.6F;
837837
}
838838
}
839839

840-
return new Vec3d(0.02F + f12, 0.02F + f12, 0.2F + f12);
840+
return new Vec3d(0.02F + visibility, 0.02F + visibility, 0.2F + visibility);
841841
} else if (state.getMaterial() == Material.LAVA) {
842842
return new Vec3d(0.6F, 0.1F, 0.0F);
843843
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Minecraft Forge, Patchwork Project
3+
* Copyright (c) 2016-2020, 2019-2020
4+
*
5+
* This library is free software; you can redistribute it and/or
6+
* modify it under the terms of the GNU Lesser General Public
7+
* License as published by the Free Software Foundation version 2.1
8+
* of the License.
9+
*
10+
* This library is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13+
* Lesser General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU Lesser General Public
16+
* License along with this library; if not, write to the Free Software
17+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18+
*/
19+
20+
package net.patchworkmc.mixin.extensions.block;
21+
22+
import javax.annotation.Nullable;
23+
24+
import org.spongepowered.asm.mixin.Mixin;
25+
26+
import net.minecraft.block.BedBlock;
27+
import net.minecraft.block.BlockState;
28+
import net.minecraft.entity.Entity;
29+
import net.minecraft.util.math.BlockPos;
30+
import net.minecraft.world.BlockView;
31+
32+
@Mixin(BedBlock.class)
33+
public class MixinBedBlock {
34+
public boolean isBed(BlockState state, BlockView world, BlockPos pos, @Nullable Entity player) {
35+
return true;
36+
}
37+
}

patchwork-extensions-block/src/main/java/net/patchworkmc/mixin/extensions/block/MixinBlock.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ public class MixinBlock implements IForgeBlock {
4343
@Shadow
4444
@Final
4545
private float slipperiness;
46-
@Shadow
47-
@Final
48-
private int harvestLevel;
4946

5047
@Unique
5148
private Set<Identifier> cachedTags;
@@ -59,7 +56,7 @@ public float getSlipperiness(BlockState state, CollisionView world, BlockPos pos
5956

6057
@Override
6158
public int getHarvestLevel(BlockState state) {
62-
return -1; // TODO implement getHarvestLevel, really sucks for vanilla blocks so i'm putting it off
59+
throw new UnsupportedOperationException("Harvest levels not yet implemented"); // TODO implement getHarvestLevel, really sucks for vanilla blocks so i'm putting it off
6360
}
6461

6562
@Override

patchwork-extensions-block/src/main/resources/patchwork-extensions-block.mixins.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"MixinBlock",
77
"MixinBlockState",
88
"BlockTagsAccessor",
9-
"FireBlockAccessor"
9+
"FireBlockAccessor",
10+
"MixinBedBlock"
1011
],
1112
"injectors": {
1213
"defaultRequire": 1

0 commit comments

Comments
 (0)