Skip to content

Commit 16ee414

Browse files
Initial 1.21.9 Port (untested, some bugs)
1 parent 6dcf0af commit 16ee414

File tree

26 files changed

+87
-104
lines changed

26 files changed

+87
-104
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'fabric-loom' version '1.10-SNAPSHOT'
2+
id 'fabric-loom' version '1.11-SNAPSHOT'
33
id 'maven-publish'
44
}
55

gradle.properties

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
org.gradle.jvmargs=-Xmx2048m
22
# Fabric Properties
33
# check these on https://fabricmc.net/develop/
4-
minecraft_version=1.21.6
5-
yarn_mappings=1.21.6+build.1
6-
loader_version=0.16.14
4+
minecraft_version=1.21.9
5+
yarn_mappings=1.21.9+build.1
6+
loader_version=0.17.3
77

88
# Mod Properties
99
mod_version = 1.11.2
1010
maven_group = me.juancarloscp52
1111
archives_base_name = bedrockify
1212

1313
# Dependencies
14-
fabric_version=0.127.0+1.21.6
15-
modmenu_version=15.0.0-beta.3
16-
cloth_config_version=19.0.147
17-
apple_skin=mc1.21.6-3.0.6
14+
fabric_version=0.134.0+1.21.9
15+
modmenu_version=16.0.0-rc.1
16+
cloth_config_version=20.0.148
17+
apple_skin=mc1.21.9-3.0.7
1818
dab_version=2.6.3+1.21.3-fabric
1919
iris_version=1.7.1+1.21
2020
sodium_version=mc1.20.1-0.5.10

src/main/java/me/juancarloscp52/bedrockify/client/BedrockifyClient.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343

4444
public class BedrockifyClient implements ClientModInitializer {
4545

46+
private static final KeyBinding.Category BEDROCKIFY_CATEGORY = KeyBinding.Category.create(Identifier.of("bedrockify","bedrockify"));
47+
4648
private static BedrockifyClient instance;
4749
public static final Logger LOGGER = LogManager.getLogger();
4850
public ReachAroundPlacement reachAroundPlacement;
@@ -75,7 +77,7 @@ public void onInitializeClient() {
7577
bedrockBlockShading = new BedrockBlockShading();
7678
bedrockSunGlareShading = new BedrockSunGlareShading();
7779
hudOpacity = new HudOpacity();
78-
keyBinding = KeyBindingHelper.registerKeyBinding(new KeyBinding("bedrockIfy.key.settings", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_B, "BedrockIfy"));
80+
keyBinding = KeyBindingHelper.registerKeyBinding(new KeyBinding("bedrockIfy.key.settings", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_B, BEDROCKIFY_CATEGORY));
7981

8082
// Register 3D Bobber Entity.
8183
EntityModelLayerRegistry.registerModelLayer(FishingBobber3DModel.MODEL_LAYER, FishingBobber3DModel::generateModel);

src/main/java/me/juancarloscp52/bedrockify/client/features/bedrockShading/BedrockBlockShading.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public float getBlockShade (Direction direction){
1313
MinecraftClient client = MinecraftClient.getInstance();
1414
return switch (direction) {
1515
case UP -> 1.0f;
16-
case DOWN -> client.player.getWorld().getRegistryKey() == World.NETHER ? 0.9f : 0.87f;
16+
case DOWN -> client.player.getEntityWorld().getRegistryKey() == World.NETHER ? 0.9f : 0.87f;
1717
case NORTH, SOUTH -> 0.95f;
1818
default -> 0.9f;
1919
};

src/main/java/me/juancarloscp52/bedrockify/client/gui/Overlay.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import me.juancarloscp52.bedrockify.client.features.savingOverlay.SavingOverlay;
77
import net.minecraft.client.MinecraftClient;
88
import net.minecraft.client.gui.DrawContext;
9+
import net.minecraft.client.gui.hud.DebugHud;
10+
import net.minecraft.client.gui.hud.InGameHud;
911
import net.minecraft.text.MutableText;
1012
import net.minecraft.text.Text;
1113
import net.minecraft.util.math.BlockPos;
@@ -41,7 +43,7 @@ public void renderOverlay(DrawContext drawContext) {
4143
* Renders the text components for the player position and client fps.
4244
*/
4345
private void renderText(DrawContext drawContext) {
44-
fps = Text.translatable("bedrockify.hud.fps").append(" " + this.client.fpsDebugString.split(" fps")[0].trim());
46+
fps = Text.translatable("bedrockify.hud.fps").append(String.valueOf(client.getCurrentFps()));
4547
renderPositionText(drawContext);
4648
renderFpsText(drawContext);
4749
}

src/main/java/me/juancarloscp52/bedrockify/common/block/ColoredWaterCauldronBlock.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import net.minecraft.state.StateManager;
99
import net.minecraft.state.property.IntProperty;
1010
import net.minecraft.util.math.BlockPos;
11+
import net.minecraft.util.math.Direction;
1112
import net.minecraft.util.math.MathHelper;
1213
import net.minecraft.world.World;
1314
import net.minecraft.world.event.GameEvent;
@@ -40,7 +41,7 @@ public boolean isFull(BlockState state) {
4041
}
4142

4243
@Override
43-
public int getComparatorOutput(BlockState state, World world, BlockPos pos) {
44+
public int getComparatorOutput(BlockState state, World world, BlockPos pos, Direction direction) {
4445
return (int) Math.ceil((float) state.get(LEVEL) / MAX_LEVEL * LeveledCauldronBlock.MAX_LEVEL);
4546
}
4647

src/main/java/me/juancarloscp52/bedrockify/common/block/PotionCauldronBlock.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@
77
import me.juancarloscp52.bedrockify.common.features.cauldron.BedrockCauldronProperties;
88
import net.minecraft.block.*;
99
import net.minecraft.item.ItemStack;
10-
import net.minecraft.particle.EntityEffectParticleEffect;
1110
import net.minecraft.particle.ParticleTypes;
11+
import net.minecraft.particle.TintedParticleEffect;
1212
import net.minecraft.state.StateManager;
1313
import net.minecraft.state.property.IntProperty;
1414
import net.minecraft.util.math.BlockPos;
15+
import net.minecraft.util.math.Direction;
1516
import net.minecraft.util.math.MathHelper;
1617
import net.minecraft.util.math.random.Random;
1718
import net.minecraft.world.World;
@@ -55,7 +56,7 @@ public boolean isFull(BlockState state) {
5556
}
5657

5758
@Override
58-
public int getComparatorOutput(BlockState state, World world, BlockPos pos) {
59+
public int getComparatorOutput(BlockState state, World world, BlockPos pos, Direction direction) {
5960
return (int) Math.ceil((float) state.get(LEVEL) / MAX_LEVEL * LeveledCauldronBlock.MAX_LEVEL);
6061
}
6162

@@ -97,7 +98,7 @@ public void randomDisplayTick(BlockState state, World world, BlockPos pos, Rando
9798
final double x = pos.getX() + 0.45 + random.nextDouble() * 0.2;
9899
final double y = pos.getY() + offsetY;
99100
final double z = pos.getZ() + 0.45 + random.nextDouble() * 0.2;
100-
world.addParticleClient(EntityEffectParticleEffect.create(ParticleTypes.ENTITY_EFFECT, red, green, blue), x, y, z, red, green, blue);
101+
world.addParticleClient(TintedParticleEffect.create(ParticleTypes.ENTITY_EFFECT, red, green, blue), x, y, z, red, green, blue);
101102
});
102103
}
103104

@@ -110,7 +111,7 @@ public void randomDisplayTick(BlockState state, World world, BlockPos pos, Rando
110111
* @return <code>true</code> if it can be taken out.
111112
*/
112113
public static boolean tryPickFluid(BlockState state, World world, BlockPos pos) {
113-
if (world.isClient) {
114+
if (world.isClient()) {
114115
return false;
115116
}
116117

src/main/java/me/juancarloscp52/bedrockify/common/block/cauldron/BedrockCauldronBehavior.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public interface BedrockCauldronBehavior {
6161
}
6262

6363
final WaterCauldronBlockEntity blockEntity = entity.get();
64-
if (!world.isClient) {
64+
if (!world.isClient()) {
6565
ColoredWaterCauldronBlock.decrementWhenDye(state, world, pos);
6666
player.incrementStat(Stats.USE_CAULDRON);
6767
player.setStackInHand(hand, ColorBlenderHelper.blendColors(stack, blockEntity.getTintColor()));
@@ -99,7 +99,7 @@ public interface BedrockCauldronBehavior {
9999
level = ColoredWaterCauldronBlock.getLevelFromWaterCauldronState(state);
100100
}
101101

102-
if (!world.isClient) {
102+
if (!world.isClient()) {
103103
BlockState newState = BedrockCauldronBlocks.COLORED_WATER_CAULDRON.getDefaultState()
104104
.with(ColoredWaterCauldronBlock.LEVEL, level);
105105
world.setBlockState(pos, newState);
@@ -144,7 +144,7 @@ public interface BedrockCauldronBehavior {
144144
nextLevel = Blocks.WATER_CAULDRON.getDefaultState().get(LeveledCauldronBlock.LEVEL);
145145
}
146146

147-
if (!world.isClient) {
147+
if (!world.isClient()) {
148148
// Replace with Water Cauldron.
149149
player.incrementStat(Stats.USE_CAULDRON);
150150
player.incrementStat(Stats.USED.getOrCreateStat(stack.getItem()));
@@ -180,7 +180,7 @@ public interface BedrockCauldronBehavior {
180180
final Potion potion = optionalPotion.get();
181181
RegistryEntry<Potion> potionEntry = Registries.POTION.getEntry(potion);
182182
final Item potionType = blockEntity.getPotionType();
183-
if (!world.isClient) {
183+
if (!world.isClient()) {
184184
if (!PotionCauldronBlock.tryPickFluid(state, world, pos)) {
185185
return ActionResult.SUCCESS_SERVER;
186186
}
@@ -260,7 +260,7 @@ public interface BedrockCauldronBehavior {
260260
}
261261

262262
final ItemStack processing = stack.copy();
263-
if (!world.isClient) {
263+
if (!world.isClient()) {
264264
player.incrementStat(Stats.USE_CAULDRON);
265265
player.incrementStat(Stats.USED.getOrCreateStat(stack.getItem()));
266266
player.setStackInHand(hand, ItemUsage.exchangeStack(stack, player, new ItemStack(Items.GLASS_BOTTLE)));
@@ -303,7 +303,7 @@ public interface BedrockCauldronBehavior {
303303

304304
final Potion potion = optionalPotion.get();
305305
RegistryEntry<Potion> potionEntry = Registries.POTION.getEntry(potion);
306-
if (!world.isClient) {
306+
if (!world.isClient()) {
307307
// Determine arrow count and fluid level to decrease.
308308
final int tippedArrowCount = PotionCauldronBlock.getMaxTippedArrowCount(stack, state);
309309
if (tippedArrowCount <= 0) {
@@ -353,7 +353,7 @@ public interface BedrockCauldronBehavior {
353353
};
354354

355355
CauldronBehavior PICK_COLORED_WATER = (state, world, pos, player, hand, stack) -> {
356-
if (!world.isClient) {
356+
if (!world.isClient()) {
357357
if (!ColoredWaterCauldronBlock.tryPickFluid(state, world, pos)) {
358358
return ActionResult.SUCCESS_SERVER;
359359
}
@@ -431,7 +431,7 @@ static void registerEvaporateBucketBehavior(Map<Item, CauldronBehavior> map) {
431431
* Empties the cauldron by spawning particles and sound.
432432
*/
433433
static ActionResult evaporateCauldron(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, ItemStack current, ItemStack after) {
434-
if (!world.isClient) {
434+
if (!world.isClient()) {
435435
final Identifier particleId = Registries.PARTICLE_TYPE.getId(ParticleTypes.POOF);
436436
for (int i = 0; i < 10; ++i) {
437437
CauldronParticlePayload particlePayload = new CauldronParticlePayload();
@@ -451,7 +451,7 @@ static ActionResult evaporateCauldron(BlockState state, World world, BlockPos po
451451
* Spawns particles after interacting with a potion.
452452
*/
453453
static void addPotionParticle(BlockState state, World world, BlockPos pos, int color) {
454-
if (world.isClient) {
454+
if (world.isClient()) {
455455
return;
456456
}
457457

src/main/java/me/juancarloscp52/bedrockify/common/features/animalEatingParticles/EatingParticlesUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
public class EatingParticlesUtil {
1313

1414
public static void spawnItemParticles(PlayerEntity player, ItemStack stack, AnimalEntity entity) {
15-
if (player.getWorld().isClient)
15+
if (player.getEntityWorld().isClient())
1616
return;
1717
int count = 16;
1818
for (int i = 0; i < count; ++i) {
@@ -28,7 +28,7 @@ public static void spawnItemParticles(PlayerEntity player, ItemStack stack, Anim
2828
particlePayload.setPosition(vec3d2);
2929
particlePayload.setVelocity(vec3d);
3030
particlePayload.setItemStack(stack);
31-
PlayerLookup.world((ServerWorld) player.getWorld()).forEach(serverPlayerEntity ->
31+
PlayerLookup.world((ServerWorld) player.getEntityWorld()).forEach(serverPlayerEntity ->
3232
ServerPlayNetworking.send(serverPlayerEntity, particlePayload));
3333
}
3434
}

src/main/java/me/juancarloscp52/bedrockify/common/payloads/CauldronParticlePayload.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
import net.minecraft.client.MinecraftClient;
66
import net.minecraft.network.RegistryByteBuf;
77
import net.minecraft.network.codec.PacketCodec;
8-
import net.minecraft.particle.EntityEffectParticleEffect;
98
import net.minecraft.particle.ParticleEffect;
109
import net.minecraft.particle.ParticleTypes;
10+
import net.minecraft.particle.TintedParticleEffect;
1111
import net.minecraft.registry.Registries;
1212
import net.minecraft.util.Identifier;
1313

@@ -66,7 +66,7 @@ public void receive(CauldronParticlePayload payload, ClientPlayNetworking.Contex
6666
} else if (particle.equals(ParticleTypes.ENTITY_EFFECT)) {
6767
client.execute(() -> {
6868
if (null != client.world) {
69-
client.world.addParticleClient(EntityEffectParticleEffect.create(ParticleTypes.ENTITY_EFFECT, vx, vy, vz), x, y, z, vx, vy, vz);
69+
client.world.addParticleClient(TintedParticleEffect.create(ParticleTypes.ENTITY_EFFECT, vx, vy, vz), x, y, z, vx, vy, vz);
7070
}
7171
});
7272
}

0 commit comments

Comments
 (0)