Skip to content

Commit

Permalink
Update to 1.20.2
Browse files Browse the repository at this point in the history
  • Loading branch information
DragonEggBedrockBreaking committed Oct 1, 2023
1 parent dc72e88 commit af57b65
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 24 deletions.
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ org.gradle.jvmargs=-Xmx1G
org.gradle.parallel=true

# Fabric Properties - check these on https://fabricmc.net/develop
minecraft_version=1.20.1
loader_version=0.14.21
fabric_version=0.88.1+1.20.1
minecraft_version=1.20.2
loader_version=0.14.22
fabric_version=0.89.2+1.20.2
parchment_version=parchment-1.20.1:2023.08.20

# Mod Properties
Expand All @@ -19,6 +19,6 @@ mixin_extras_version=0.2.0-rc.5
h2_version=2.2.224
caffeine_version=3.1.8
toml4j_version=0.7.2
modmenu_version=7.2.1
owo_version=0.11.2+1.20
modmenu_version=8.0.0
owo_version=0.11.2-pre.14+1.20
conditional_mixin_version=v0.3.2
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ protected void build(FlowLayout rootComponent) {
}
entries.child(entry.tooltip(description));
});
if (entries.children().size() > 0) {
if (!entries.children().isEmpty()) {
overall.child(Containers.collapsible(Sizing.fill(100), Sizing.content(), Component.literal(group).withStyle(ChatFormatting.GREEN), true).child(entries));
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void onPress() {

@Override
public void render(GuiGraphics g, int mouseX, int mouseY, float partialTick) {
this.renderBackground(g);
this.renderBackground(g, mouseX, mouseY, partialTick);
super.render(g, mouseX, mouseY, partialTick);
g.drawCenteredString(this.font, this.title, width / 2, 36, 16777215);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ protected void init() {

@Override
public void render(GuiGraphics g, int mouseX, int mouseY, float partialTick) {
this.renderBackground(g);
this.renderBackground(g, mouseX, mouseY, partialTick);
super.render(g, mouseX, mouseY, partialTick);
g.drawCenteredString(this.font, this.title, width / 2, 48, 16777215);
g.drawCenteredString(this.font, Component.translatable("vd.worldgen_config.description.1"), width / 2, 72, 16777215);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ public static void populate() {
}}));

server.getAdvancements().getAllAdvancements().forEach(advancement -> {
String name = advancement.getId().toString();
String name = advancement.id().toString();
if (!name.contains("recipe")) {
advancements.put(name, new Object2ObjectOpenHashMap<>() {{
put("enabled", "true");
Expand Down Expand Up @@ -1034,7 +1034,7 @@ public static void writeToFile(String command) {
* @param isString Whether the value is a string.
*/
public static void setValue(String table, String row, String column, String value, boolean isString) {
if (table.equals("") || row.equals("") || column.equals("") || value.equals("")) return;
if (table.isEmpty() || row.isEmpty() || column.isEmpty() || value.isEmpty()) return;
invalidateCaches();
if (isString) {
value = "'" + value + "'";
Expand All @@ -1057,7 +1057,7 @@ public static void setValue(String table, String row, String column, String valu
* @param isString Whether the value is a string.
*/
public static void setAll(String table, String column, String value, boolean isString) {
if (table.equals("") || column.equals("") || value.equals("")) return;
if (table.isEmpty() || column.isEmpty() || value.isEmpty()) return;
invalidateCaches();
if (isString) {
value = "'" + value + "'";
Expand All @@ -1081,7 +1081,7 @@ public static void setAll(String table, String column, String value, boolean isS
* @param pattern The pattern to match.
*/
public static void setMatching(String table, String column, String value, boolean isString, String pattern) {
if (table.equals("") || column.equals("") || value.equals("") || pattern.equals("")) return;
if (table.isEmpty() || column.isEmpty() || value.isEmpty() || pattern.isEmpty()) return;
invalidateCaches();
if (pattern.contains(";") || pattern.contains("SELECT") || pattern.contains("ALTER")) {
throw new RuntimeException("SQL injection attempted. Command not executed.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,7 @@ public class GameruleMigrationDataHandler {

public static void updateSql() {
sqlData.forEach(sqlDataHolder -> {
if (sqlDataHolder.value != null && !sqlDataHolder.value.equals("") && !sqlDataHolder.value.equals(sqlDataHolder.defaultValue)) {
if (sqlDataHolder.value != null && !sqlDataHolder.value.isEmpty() && !sqlDataHolder.value.equals(sqlDataHolder.defaultValue)) {
CommandDataHandler.setMatching(sqlDataHolder.table, sqlDataHolder.column, sqlDataHolder.value, false, sqlDataHolder.pattern);
}
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package uk.debb.vanilla_disable.mixin.command.advancement;

import net.minecraft.ChatFormatting;
import net.minecraft.advancements.Advancement;
import net.minecraft.advancements.AdvancementHolder;
import net.minecraft.network.chat.Component;
import net.minecraft.server.PlayerAdvancements;
import org.spongepowered.asm.mixin.Mixin;
Expand All @@ -13,8 +13,8 @@
@Mixin(PlayerAdvancements.class)
public abstract class MixinPlayerAdvancements {
@Inject(method = "award", at = @At("RETURN"), cancellable = true)
private void vanillaDisable$award(Advancement advancement, String criterionKey, CallbackInfoReturnable<Boolean> cir) {
String adv = advancement.getId().toString();
private void vanillaDisable$award(AdvancementHolder advancementHolder, String string, CallbackInfoReturnable<Boolean> cir) {
String adv = advancementHolder.id().toString();
if (!adv.contains("recipe") && !CommandDataHandler.getCachedBoolean("advancements", adv, "enabled")) {
CommandDataHandler.server.getPlayerList().broadcastSystemMessage(Component.translatable("vd.advancements.disabled.by.vd").withStyle(ChatFormatting.RED), false);
cir.setReturnValue(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public abstract class MixinItemStack {
if (name.equals("minecraft:powder_snow_bucket")) {
name = "minecraft:powder_snow";
}
if (!name.equals("")) {
if (!name.isEmpty()) {
String col = "invalid dimension";
if (dimensionType.equals(OVERWORLD_EFFECTS)) {
col = "can_place_in_overworld";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.game.ClientboundExplodePacket;
import net.minecraft.server.network.ServerGamePacketListenerImpl;
import net.minecraft.server.network.ServerCommonPacketListenerImpl;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import uk.debb.vanilla_disable.data.command.CommandDataHandler;

@Mixin(ServerGamePacketListenerImpl.class)
public abstract class MixinServerGamePacketListenerImpl {
@Mixin(ServerCommonPacketListenerImpl.class)
public abstract class MixinServerCommonPacketListenerImpl {
@Inject(method = "send(Lnet/minecraft/network/protocol/Packet;)V", at = @At("HEAD"), cancellable = true)
public void vanillaDisable$send(Packet<?> packet, CallbackInfo ci) {
if (packet instanceof ClientboundExplodePacket &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.Style;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.server.network.CommonListenerCookie;
import net.minecraft.server.players.PlayerList;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
Expand All @@ -20,7 +21,7 @@ public abstract class MixinPlayerList {
public abstract void broadcastSystemMessage(Component component, boolean bl);

@Inject(method = "placeNewPlayer", at = @At("RETURN"))
private void vanillaDisable$placeNewPlayer(Connection netManager, ServerPlayer player, CallbackInfo ci) {
private void vanillaDisable$placeNewPlayer(Connection connection, ServerPlayer serverPlayer, CommonListenerCookie commonListenerCookie, CallbackInfo ci) {
if (CommandDataHandler.migrated) {
CommandDataHandler.migrated = false;
this.broadcastSystemMessage(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import java.util.Set;

public class VanillaDisableMixinPlugin implements IMixinConfigPlugin {
CaffeineConfigMixinPlugin caffeineConfigMixinPlugin = new CaffeineConfigMixinPlugin();
ConditionalMixinMixinPlugin conditionalMixinMixinPlugin = new ConditionalMixinMixinPlugin();
final CaffeineConfigMixinPlugin caffeineConfigMixinPlugin = new CaffeineConfigMixinPlugin();
final ConditionalMixinMixinPlugin conditionalMixinMixinPlugin = new ConditionalMixinMixinPlugin();

@Override
public void onLoad(String mixinPackage) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/vanilla_disable.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"command.entity.experience.MixinLivingEntity",
"command.entity.experience.MixinThrownExperienceBottle",
"command.entity.knockback.MixinLivingEntity",
"command.entity.knockback.MixinServerGamePacketListenerImpl",
"command.entity.knockback.MixinServerCommonPacketListenerImpl",
"command.entity.other.MixinDragonStrafePlayerPhase",
"command.entity.other.MixinEntity",
"command.entity.other.MixinLivingEntity",
Expand Down

0 comments on commit af57b65

Please sign in to comment.