Skip to content

Commit

Permalink
Update to 1.20.1
Browse files Browse the repository at this point in the history
  • Loading branch information
2No2Name committed Jul 14, 2023
1 parent 0de165c commit 38244ef
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 34 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '0.12-SNAPSHOT'
id 'fabric-loom' version '0.13-SNAPSHOT'
id 'maven-publish'
}

Expand Down
12 changes: 7 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.19.4
yarn_mappings=1.19.4+build.1
loader_version=0.14.17
minecraft_version=1.20.1
yarn_mappings=1.20.1+build.9
loader_version=0.14.21

#Fabric api
fabric_version=0.85.0+1.20.1

# Mod Properties
mod_version=1.0.4
maven_group=mendedminecarts
archives_base_name=mendedminecarts
# Dependencies
fabric_version=0.76.0+1.19.4
12 changes: 6 additions & 6 deletions src/main/java/mendedminecarts/MendedMinecartsSettingCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ public static void register(CommandDispatcher<ServerCommandSource> dispatcher) {


private static int listSettings(ServerCommandSource source) {
source.sendFeedback(Text.translatable("mendedminecarts.available_settings"), false);
source.sendFeedback(Text.translatable(""), false);
source.sendFeedback(() -> Text.translatable("mendedminecarts.available_settings"), false);
source.sendFeedback(() -> Text.translatable(""), false);
for (Setting setting : MendedMinecartsMod.SETTINGS) {
source.sendFeedback(setting.asText(), false);
source.sendFeedback(setting.getDefault(), false);
source.sendFeedback(setting.getDescription(), false);
source.sendFeedback(Text.literal(""), false);
source.sendFeedback(setting::asText, false);
source.sendFeedback(setting::getDefault, false);
source.sendFeedback(setting::getDescription, false);
source.sendFeedback(() -> Text.literal(""), false);
}
return 1;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private boolean simulateCartsOnClientLikeOnServer(World instance) {
cancellable = true
)
private void setCartPosLikeOtherEntities(double x, double y, double z, float yaw, float pitch, int interpolationSteps, boolean interpolate, CallbackInfo ci) {
if (this.world.isClient && (MendedMinecartsMod.ACCURATE_CLIENT_MINECARTS.isEnabled() || MendedMinecartsMod.NO_CLIENT_CART_INTERPOLATION.isEnabled())) {
if (this.getWorld().isClient && (MendedMinecartsMod.ACCURATE_CLIENT_MINECARTS.isEnabled() || MendedMinecartsMod.NO_CLIENT_CART_INTERPOLATION.isEnabled())) {
ci.cancel();
super.updateTrackedPositionAndAngles(x, y, z, yaw, pitch, interpolationSteps, interpolate);
}
Expand All @@ -63,7 +63,7 @@ private void setCartPosLikeOtherEntities(double x, double y, double z, float yaw
at = @At("HEAD")
)
private void updateDisplayInfo(CallbackInfo ci) {
if (!this.world.isClient()) {
if (!this.getWorld().isClient()) {
return;
}
if (MendedMinecartsMod.DISPLAY_CART_DATA.isEnabled() &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void fixVelocityLoss(BlockPos previousPos, BlockState state, CallbackInfo
if (!hasHitWall) {
return;
}
BlockState blockState = this.world.getBlockState(this.getBlockPos());
BlockState blockState = this.getWorld().getBlockState(this.getBlockPos());
if (blockState.isOf(Blocks.RAIL)) {
this.setVelocity(velocity);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ private void setRotationBetter(AbstractMinecartEntity instance, float yaw, float
}

private boolean fixRotationToRail(float yaw, float pitch) {
BlockState blockState = this.world.getBlockState(this.getBlockPos());
BlockState blockState = this.getWorld().getBlockState(this.getBlockPos());
if (blockState.getBlock() instanceof AbstractRailBlock railBlock) {
RailShape railShape = blockState.get(railBlock.getShapeProperty());
Direction.Axis railAxis = RailHitboxHelper.getRailAxis(railShape);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ private void setOnFireFromLava(TntMinecartEntity tntCart) {
return;
}
tntCart.setOnFireFor(15);
if (tntCart.damage(DamageSource.LAVA, 4.0f)) {
if (tntCart.damage(tntCart.getDamageSources().cactus(), 4.0f)) {
tntCart.playSound(SoundEvents.ENTITY_GENERIC_BURN, 0.4f, 2.0f + tntCart.getWorld().random.nextFloat() * 0.4f);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.vehicle.AbstractMinecartEntity;
import net.minecraft.text.Text;
import org.joml.Matrix4f;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
Expand Down Expand Up @@ -65,7 +66,8 @@ private void renderInfo(T entity, float yaw, float tickDelta, MatrixStack matric
Matrix4f matrix4f = matrices.peek().getPositionMatrix();
float h = -textRenderer.getWidth(infoText) / 2f;

textRenderer.draw(infoText, h, yOffset, -1, false, matrix4f, vertexConsumerProvider, TextLayerType.SEE_THROUGH, 0, light);
textRenderer.draw(infoText, h, yOffset, 0x20FFFFFF, false, matrix4f, vertexConsumerProvider, TextRenderer.TextLayerType.SEE_THROUGH, backgroundColor, light);
textRenderer.draw(infoText, h, yOffset, -1, false, matrix4f, vertexConsumerProvider, TextRenderer.TextLayerType.NORMAL, 0, light);

matrices.pop();

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/mendedminecarts/settings/BooleanSetting.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ public Text getDescription() {
@Override
public LiteralArgumentBuilder<ServerCommandSource> buildCommand() {
return CommandManager.literal(this.name).executes(commandContext -> {
commandContext.getSource().sendFeedback(this.asText(), false);
commandContext.getSource().sendFeedback(this.getDefault(), false);
commandContext.getSource().sendFeedback(this::asText, false);
commandContext.getSource().sendFeedback(this::getDefault, false);
return 1;
}).
then(CommandManager.argument("enabled", BoolArgumentType.bool()).executes((context) -> {
this.setEnabled(context.getArgument("enabled", Boolean.class));
Setting.super.onChangedByCommand();
context.getSource().sendFeedback(this.asText(), false);
context.getSource().sendFeedback(this::asText, false);
return 1;
}));
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/mendedminecarts/settings/DoubleSetting.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ public Text getDescription() {
@Override
public LiteralArgumentBuilder<ServerCommandSource> buildCommand() {
return CommandManager.literal(this.name).executes(commandContext -> {
commandContext.getSource().sendFeedback(this.asText(), false);
commandContext.getSource().sendFeedback(this.getDefault(), false);
commandContext.getSource().sendFeedback(this::asText, false);
commandContext.getSource().sendFeedback(this::getDefault, false);
return 1;
}).then(CommandManager.argument("state", DoubleArgumentType.doubleArg(this.minValue, this.maxValue)).executes((context) -> {
this.setDouble(context.getArgument("state", Double.class));
this.onChangedByCommand();
context.getSource().sendFeedback(this.asText(), false);
context.getSource().sendFeedback(this::asText, false);
return 1;
}));
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/mendedminecarts/settings/IntegerSetting.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ public Text getDescription() {
@Override
public LiteralArgumentBuilder<ServerCommandSource> buildCommand() {
return CommandManager.literal(this.name).executes(commandContext -> {
commandContext.getSource().sendFeedback(this.asText(), false);
commandContext.getSource().sendFeedback(this.getDefault(), false);
commandContext.getSource().sendFeedback(() -> this.asText(), false);
commandContext.getSource().sendFeedback(() -> this.getDefault(), false);
return 1;
}).
then(CommandManager.argument("enabled", IntegerArgumentType.integer()).executes((context) -> {
this.setEnabled(context.getArgument("enabled", Integer.class));
Setting.super.onChangedByCommand();
context.getSource().sendFeedback(this.asText(), false);
context.getSource().sendFeedback(this::asText, false);
return 1;
}));
}
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/mendedminecarts/settings/SettingGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public Text getDescription() {
@Override
public LiteralArgumentBuilder<ServerCommandSource> buildCommand() {
LiteralArgumentBuilder<ServerCommandSource> builder = CommandManager.literal(this.name).executes(commandContext -> {
commandContext.getSource().sendFeedback(this.asText(), false);
commandContext.getSource().sendFeedback(this::asText, false);
listChildren(commandContext.getSource(), this.children);
return 1;
});
Expand All @@ -65,13 +65,13 @@ public LiteralArgumentBuilder<ServerCommandSource> buildCommand() {
}

private static void listChildren(ServerCommandSource source, Setting[] children) {
source.sendFeedback(Text.translatable("mendedminecarts.available_settings"), false);
source.sendFeedback(Text.translatable(""), false);
source.sendFeedback(() -> Text.translatable("mendedminecarts.available_settings"), false);
source.sendFeedback(() -> Text.translatable(""), false);
for (Setting setting : children) {
source.sendFeedback(setting.asText(), false);
source.sendFeedback(setting.getDefault(), false);
source.sendFeedback(setting.getDescription(), false);
source.sendFeedback(Text.literal(""), false);
source.sendFeedback(setting::asText, false);
source.sendFeedback(setting::getDefault, false);
source.sendFeedback(setting::getDescription, false);
source.sendFeedback(() -> Text.literal(""), false);
}
}

Expand Down

0 comments on commit 38244ef

Please sign in to comment.