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