Update to 1.21.6
This commit is contained in:
+8
-8
@@ -3,9 +3,9 @@ org.gradle.jvmargs=-Xmx1G
|
||||
|
||||
# Fabric Properties
|
||||
# check these on https://modmuss50.me/fabric.html
|
||||
minecraft_version=1.21.5
|
||||
loader_version=0.16.13
|
||||
yarn_mappings=1.21.5+build.1
|
||||
minecraft_version=1.21.6
|
||||
loader_version=0.16.14
|
||||
yarn_mappings=1.21.6+build.1
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 0.2.0-SNAPSHOT
|
||||
@@ -14,10 +14,10 @@ org.gradle.jvmargs=-Xmx1G
|
||||
|
||||
# Dependencies
|
||||
# check this on https://modmuss50.me/fabric.html
|
||||
fabric_version=0.121.0+1.21.5
|
||||
fabric_version=0.127.1+1.21.6
|
||||
|
||||
polymer_version=0.12.3+1.21.5
|
||||
sgui_version=1.9.0+1.21.5
|
||||
server_translations_version=2.5.0+1.21.5-rc1
|
||||
polymer_version=0.13.1+1.21.6
|
||||
sgui_version=1.10.0+1.21.6
|
||||
server_translations_version=2.5.1+1.21.5
|
||||
|
||||
universal_graves_version=3.7.1+1.21.5
|
||||
universal_graves_version=3.8.0+1.21.6
|
||||
|
||||
@@ -9,19 +9,19 @@ import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public class CommandsGui {
|
||||
public static void openServerModuleCommandGui(ServerPlayerEntity player, MinionFakePlayer minion) {
|
||||
List<ModuleItem> modules = minion.getModuleInventory().getModuleItems();
|
||||
Collection<ModuleItem> modules = minion.getModuleInventory().getModuleItems();
|
||||
|
||||
SimpleGui gui = new SimpleGui(ScreenHandlerType.GENERIC_9X3, player, false);
|
||||
|
||||
gui.setTitle(Text.translatable("minions.gui.module_commands.title"));
|
||||
|
||||
for (int i = 0; i < modules.size(); i++) {
|
||||
ModuleItem module = modules.get(i);
|
||||
gui.setSlot(i, new GuiElementBuilder()
|
||||
for (ModuleItem module : modules) {
|
||||
gui.addSlot(new GuiElementBuilder()
|
||||
.setItem(module.asItem())
|
||||
.setCallback(() -> openServerCommandGui(player, minion, module))
|
||||
);
|
||||
|
||||
@@ -43,7 +43,7 @@ public class MinionGui {
|
||||
.setItem(Items.BARRIER)
|
||||
.setName(Text.translatable("minions.gui.main.pickup"))
|
||||
.setCallback(() -> {
|
||||
minion.kill(minion.getServerWorld());
|
||||
minion.kill(minion.getWorld());
|
||||
})
|
||||
);
|
||||
gui.open();
|
||||
|
||||
@@ -4,16 +4,13 @@ import io.github.skippyall.minions.module.command.Command;
|
||||
import io.github.skippyall.minions.minion.fakeplayer.MinionFakePlayer;
|
||||
import io.github.skippyall.minions.module.ModuleItem;
|
||||
import io.github.skippyall.minions.program.block.CodeBlock;
|
||||
import net.fabricmc.fabric.impl.transfer.item.ComposterWrapper;
|
||||
import net.fabricmc.fabric.mixin.transfer.JukeboxBlockEntityMixin;
|
||||
import net.minecraft.block.ComposterBlock;
|
||||
import net.minecraft.inventory.Inventories;
|
||||
import net.minecraft.inventory.SimpleInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.registry.RegistryWrapper;
|
||||
import net.minecraft.screen.SimpleNamedScreenHandlerFactory;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.storage.ReadView;
|
||||
import net.minecraft.storage.WriteView;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -57,13 +54,13 @@ public class ModuleInventory extends SimpleInventory {
|
||||
}
|
||||
}
|
||||
|
||||
public void readNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup lookup) {
|
||||
Inventories.readNbt(nbt, heldStacks, lookup);
|
||||
public void readData(ReadView view) {
|
||||
Inventories.readData(view, heldStacks);
|
||||
updateModules();
|
||||
}
|
||||
|
||||
public NbtCompound writeNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup lookup) {
|
||||
return Inventories.writeNbt(nbt, heldStacks, lookup);
|
||||
public void writeData(WriteView view) {
|
||||
Inventories.writeData(view, heldStacks);
|
||||
}
|
||||
|
||||
public boolean hasModule(ModuleItem module) {
|
||||
|
||||
+2
-2
@@ -317,11 +317,11 @@ public class EntityPlayerActionPack
|
||||
case BLOCK:
|
||||
{
|
||||
player.updateLastActionTime();
|
||||
ServerWorld world = player.getServerWorld();
|
||||
ServerWorld world = player.getWorld();
|
||||
BlockHitResult blockHit = (BlockHitResult) hit;
|
||||
BlockPos pos = blockHit.getBlockPos();
|
||||
Direction side = blockHit.getSide();
|
||||
if (pos.getY() < player.getServerWorld().getTopYInclusive() - (side == Direction.UP ? 1 : 0) && world.canEntityModifyAt(player, pos))
|
||||
if (pos.getY() < player.getWorld().getTopYInclusive() - (side == Direction.UP ? 1 : 0) && world.canEntityModifyAt(player, pos))
|
||||
{
|
||||
ActionResult result = player.interactionManager.interactBlock(player, world, player.getStackInHand(hand), hand, blockHit);
|
||||
if (result instanceof ActionResult.Success success)
|
||||
|
||||
@@ -21,7 +21,6 @@ import net.minecraft.entity.damage.DamageSource;
|
||||
import net.minecraft.entity.player.HungerManager;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.network.DisconnectionInfo;
|
||||
import net.minecraft.network.NetworkSide;
|
||||
import net.minecraft.network.packet.c2s.common.SyncedClientOptions;
|
||||
@@ -33,6 +32,8 @@ import net.minecraft.server.ServerTask;
|
||||
import net.minecraft.server.network.ConnectedClientData;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.storage.ReadView;
|
||||
import net.minecraft.storage.WriteView;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableTextContent;
|
||||
import net.minecraft.util.ActionResult;
|
||||
@@ -151,7 +152,7 @@ public class MinionFakePlayer extends ServerPlayerEntity {
|
||||
if (reason.getContent() instanceof TranslatableTextContent text && text.getKey().equals("multiplayer.disconnect.duplicate_login")) {
|
||||
this.networkHandler.onDisconnected(new DisconnectionInfo(reason));
|
||||
} else {
|
||||
this.server.send(new ServerTask(this.server.getTicks(), () -> {
|
||||
this.getServer().send(new ServerTask(this.getServer().getTicks(), () -> {
|
||||
this.networkHandler.onDisconnected(new DisconnectionInfo(reason));
|
||||
}));
|
||||
}
|
||||
@@ -165,7 +166,7 @@ public class MinionFakePlayer extends ServerPlayerEntity {
|
||||
if (this.getServer().getTicks() % 10 == 0)
|
||||
{
|
||||
this.networkHandler.syncWithPlayerPosition();
|
||||
this.getServerWorld().getChunkManager().updatePosition(this);
|
||||
this.getWorld().getChunkManager().updatePosition(this);
|
||||
}
|
||||
try
|
||||
{
|
||||
@@ -291,14 +292,14 @@ public class MinionFakePlayer extends ServerPlayerEntity {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeCustomDataToNbt(NbtCompound nbt) {
|
||||
super.writeCustomDataToNbt(nbt);
|
||||
nbt.put("modules", moduleInventory.writeNbt(new NbtCompound(), getRegistryManager()));
|
||||
public void writeCustomData(WriteView view) {
|
||||
super.writeCustomData(view);
|
||||
moduleInventory.writeData(view.get("modules"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readCustomDataFromNbt(NbtCompound nbt) {
|
||||
super.readCustomDataFromNbt(nbt);
|
||||
moduleInventory.readNbt(nbt.getCompoundOrEmpty("modules"), getRegistryManager());
|
||||
public void readCustomData(ReadView view) {
|
||||
super.readCustomData(view);
|
||||
moduleInventory.readData(view.getReadView("modules"));
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -38,9 +38,9 @@ public class NetHandlerPlayServerFake extends ServerPlayNetworkHandler
|
||||
public void requestTeleport(PlayerPosition pos, Set<PositionFlag> set)
|
||||
{
|
||||
super.requestTeleport(pos, set);
|
||||
if (player.getServerWorld().getPlayerByUuid(player.getUuid()) != null) {
|
||||
if (player.getWorld().getPlayerByUuid(player.getUuid()) != null) {
|
||||
syncWithPlayerPosition();
|
||||
player.getServerWorld().getChunkManager().updatePosition(player);
|
||||
player.getWorld().getChunkManager().updatePosition(player);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user