1.16-pre3
This commit is contained in:
1 parent
9e80222338
commit
441676a1e5
5 files changed
+14
-13
No files matched your search
+2
-2
@@ -4,8 +4,8 @@ org.gradle.jvmargs=-Xmx1G
|
|||||||
# Fabric Properties
|
# Fabric Properties
|
||||||
# check these on https://fabricmc.net/use
|
# check these on https://fabricmc.net/use
|
||||||
# or better: https://modmuss50.me/fabric.html
|
# or better: https://modmuss50.me/fabric.html
|
||||||
minecraft_version=1.16-pre2
|
minecraft_version=1.16-pre3
|
||||||
yarn_mappings=1.16-pre2+build.29
|
yarn_mappings=1.16-pre3+build.1
|
||||||
loader_version=0.8.7+build.201
|
loader_version=0.8.7+build.201
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
|
|||||||
@@ -237,7 +237,7 @@ public class PlayerCommand
|
|||||||
source::getRotation
|
source::getRotation
|
||||||
);
|
);
|
||||||
RegistryKey<World> dimType = tryGetArg(
|
RegistryKey<World> dimType = tryGetArg(
|
||||||
() -> DimensionArgumentType.getDimensionArgument(context, "dimension"),
|
() -> DimensionArgumentType.getDimensionArgument(context, "dimension").getRegistryKey(),
|
||||||
() -> source.getWorld().getRegistryKey() // dimension.getType()
|
() -> source.getWorld().getRegistryKey() // dimension.getType()
|
||||||
);
|
);
|
||||||
GameMode mode = GameMode.CREATIVE;
|
GameMode mode = GameMode.CREATIVE;
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import net.minecraft.entity.SpawnGroup;
|
|||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.server.command.ServerCommandSource;
|
import net.minecraft.server.command.ServerCommandSource;
|
||||||
import net.minecraft.server.network.ServerPlayerEntity;
|
import net.minecraft.server.network.ServerPlayerEntity;
|
||||||
|
import net.minecraft.server.world.ServerWorld;
|
||||||
import net.minecraft.util.DyeColor;
|
import net.minecraft.util.DyeColor;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.registry.RegistryKey;
|
import net.minecraft.util.registry.RegistryKey;
|
||||||
@@ -260,9 +261,9 @@ public class SpawnCommand
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int mobcapsForDimension(ServerCommandSource source, RegistryKey<World> dim)
|
private static int mobcapsForDimension(ServerCommandSource source, ServerWorld world)
|
||||||
{
|
{
|
||||||
Messenger.send(source, SpawnReporter.printMobcapsForDimension(source.getMinecraftServer().getWorld(dim), true));
|
Messenger.send(source, SpawnReporter.printMobcapsForDimension(world, true));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,10 +2,9 @@ package carpet.mixins;
|
|||||||
|
|
||||||
import carpet.CarpetSettings;
|
import carpet.CarpetSettings;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.server.world.ServerWorld;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.Box;
|
import net.minecraft.util.math.Box;
|
||||||
import net.minecraft.util.registry.RegistryKey;
|
|
||||||
import net.minecraft.world.dimension.DimensionType;
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
@@ -22,7 +21,7 @@ public abstract class Entity_portalSuffocationMixin
|
|||||||
value = "INVOKE",
|
value = "INVOKE",
|
||||||
target = "Lnet/minecraft/entity/Entity;getLastNetherPortalDirection()Lnet/minecraft/util/math/Direction;"
|
target = "Lnet/minecraft/entity/Entity;getLastNetherPortalDirection()Lnet/minecraft/util/math/Direction;"
|
||||||
))
|
))
|
||||||
private void registerEntityDimensionChange(RegistryKey<DimensionType> newDimension, CallbackInfoReturnable<Entity> cir)
|
private void registerEntityDimensionChange(ServerWorld serverWorld, CallbackInfoReturnable<Entity> cir)
|
||||||
{
|
{
|
||||||
if (CarpetSettings.portalSuffocationFix)
|
if (CarpetSettings.portalSuffocationFix)
|
||||||
{
|
{
|
||||||
@@ -44,7 +43,7 @@ public abstract class Entity_portalSuffocationMixin
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "changeDimension", at = @At("RETURN"))
|
@Inject(method = "changeDimension", at = @At("RETURN"))
|
||||||
private void removeEntity(RegistryKey<DimensionType> newDimension, CallbackInfoReturnable<Entity> cir)
|
private void removeEntity(ServerWorld serverWorld, CallbackInfoReturnable<Entity> cir)
|
||||||
{
|
{
|
||||||
CarpetSettings.currentTelepotingEntityBox = null;
|
CarpetSettings.currentTelepotingEntityBox = null;
|
||||||
CarpetSettings.fixedPosition = null;
|
CarpetSettings.fixedPosition = null;
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import net.minecraft.entity.damage.DamageSource;
|
|||||||
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.server.network.ServerPlayerEntity;
|
import net.minecraft.server.network.ServerPlayerEntity;
|
||||||
|
import net.minecraft.server.world.ServerWorld;
|
||||||
import net.minecraft.stat.Stat;
|
import net.minecraft.stat.Stat;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
@@ -92,24 +93,24 @@ public abstract class ServerPlayerEntity_scarpetEventMixin extends PlayerEntity
|
|||||||
private RegistryKey<World> previousDimension;
|
private RegistryKey<World> previousDimension;
|
||||||
|
|
||||||
@Inject(method = "changeDimension", at = @At("HEAD"))
|
@Inject(method = "changeDimension", at = @At("HEAD"))
|
||||||
private void logPreviousCoordinates(RegistryKey<DimensionType> newDimension, CallbackInfoReturnable<Entity> cir)
|
private void logPreviousCoordinates(ServerWorld serverWorld, CallbackInfoReturnable<Entity> cir)
|
||||||
{
|
{
|
||||||
previousLocation = getPos();
|
previousLocation = getPos();
|
||||||
previousDimension = world.getRegistryKey(); //dimension type
|
previousDimension = world.getRegistryKey(); //dimension type
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "changeDimension", at = @At("RETURN"))
|
@Inject(method = "changeDimension", at = @At("RETURN"))
|
||||||
private void atChangeDimension(RegistryKey<World> newDimension, CallbackInfoReturnable<Entity> cir)
|
private void atChangeDimension(ServerWorld newWorld, CallbackInfoReturnable<Entity> cir)
|
||||||
{
|
{
|
||||||
if (PLAYER_CHANGES_DIMENSION.isNeeded())
|
if (PLAYER_CHANGES_DIMENSION.isNeeded())
|
||||||
{
|
{
|
||||||
ServerPlayerEntity player = (ServerPlayerEntity) (Object)this;
|
ServerPlayerEntity player = (ServerPlayerEntity) (Object)this;
|
||||||
Vec3d to = null;
|
Vec3d to = null;
|
||||||
if (!notInAnyWorld || previousDimension != World.END || newDimension != World.OVERWORLD) // end ow
|
if (!notInAnyWorld || previousDimension != World.END || newWorld.getRegistryKey() != World.OVERWORLD) // end ow
|
||||||
{
|
{
|
||||||
to = getPos();
|
to = getPos();
|
||||||
}
|
}
|
||||||
PLAYER_CHANGES_DIMENSION.onDimensionChange(player, previousLocation, to, previousDimension, newDimension);
|
PLAYER_CHANGES_DIMENSION.onDimensionChange(player, previousLocation, to, previousDimension, newWorld.getRegistryKey());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user