Remove a no longer necessary mixin
And tiny cleanup to another one
This commit is contained in:
4 files changed
+9
-32
No files matched your search
@@ -9,11 +9,9 @@ import net.minecraft.world.entity.player.Player;
|
|||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import net.minecraft.world.level.block.Blocks;
|
import net.minecraft.world.level.block.Blocks;
|
||||||
import net.minecraft.world.level.block.piston.PistonMovingBlockEntity;
|
import net.minecraft.world.level.block.piston.PistonMovingBlockEntity;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
|
||||||
import net.minecraft.world.level.material.PushReaction;
|
import net.minecraft.world.level.material.PushReaction;
|
||||||
import net.minecraft.world.phys.Vec3;
|
import net.minecraft.world.phys.Vec3;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
@@ -22,7 +20,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|||||||
@Mixin(PistonMovingBlockEntity.class)
|
@Mixin(PistonMovingBlockEntity.class)
|
||||||
public abstract class PistonMovingBlockEntity_playerHandlingMixin
|
public abstract class PistonMovingBlockEntity_playerHandlingMixin
|
||||||
{
|
{
|
||||||
|
|
||||||
@Inject(method = "moveEntityByPiston", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "moveEntityByPiston", at = @At("HEAD"), cancellable = true)
|
||||||
private static void dontPushSpectators(Direction direction, Entity entity, double d, Direction direction2, CallbackInfo ci)
|
private static void dontPushSpectators(Direction direction, Entity entity, double d, Direction direction2, CallbackInfo ci)
|
||||||
{
|
{
|
||||||
@@ -46,22 +43,17 @@ public abstract class PistonMovingBlockEntity_playerHandlingMixin
|
|||||||
if (entity instanceof EntityPlayerMPFake && pistonBlockEntity.getMovedState().is(Blocks.SLIME_BLOCK))
|
if (entity instanceof EntityPlayerMPFake && pistonBlockEntity.getMovedState().is(Blocks.SLIME_BLOCK))
|
||||||
{
|
{
|
||||||
Vec3 vec3d = entity.getDeltaMovement();
|
Vec3 vec3d = entity.getDeltaMovement();
|
||||||
double e = vec3d.x;
|
double x = vec3d.x;
|
||||||
double f = vec3d.y;
|
double y = vec3d.y;
|
||||||
double g = vec3d.z;
|
double z = vec3d.z;
|
||||||
Direction direction = pistonBlockEntity.getMovementDirection();
|
Direction direction = pistonBlockEntity.getMovementDirection();
|
||||||
switch(direction.getAxis()) {
|
switch (direction.getAxis()) {
|
||||||
case X:
|
case X -> x = direction.getStepX();
|
||||||
e = direction.getStepX();
|
case Y -> y = direction.getStepY();
|
||||||
break;
|
case Z -> z = direction.getStepZ();
|
||||||
case Y:
|
|
||||||
f = direction.getStepY();
|
|
||||||
break;
|
|
||||||
case Z:
|
|
||||||
g = direction.getStepZ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
entity.setDeltaMovement(e, f, g);
|
entity.setDeltaMovement(x, y, z);
|
||||||
}
|
}
|
||||||
return entity.getPistonPushReaction();
|
return entity.getPistonPushReaction();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
package carpet.mixins;
|
|
||||||
|
|
||||||
import net.minecraft.ChatFormatting;
|
|
||||||
import net.minecraft.world.scores.PlayerTeam;
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
|
||||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
|
||||||
|
|
||||||
@Mixin(PlayerTeam.class)
|
|
||||||
public interface PlayerTeam_scarpetMixin
|
|
||||||
{
|
|
||||||
@Accessor("color")
|
|
||||||
ChatFormatting getColor();
|
|
||||||
}
|
|
||||||
@@ -2,7 +2,6 @@ package carpet.script.api;
|
|||||||
|
|
||||||
import carpet.mixins.Objective_scarpetMixin;
|
import carpet.mixins.Objective_scarpetMixin;
|
||||||
import carpet.mixins.Scoreboard_scarpetMixin;
|
import carpet.mixins.Scoreboard_scarpetMixin;
|
||||||
import carpet.mixins.PlayerTeam_scarpetMixin;
|
|
||||||
import carpet.script.CarpetContext;
|
import carpet.script.CarpetContext;
|
||||||
import carpet.script.Expression;
|
import carpet.script.Expression;
|
||||||
import carpet.script.exception.InternalExpressionException;
|
import carpet.script.exception.InternalExpressionException;
|
||||||
@@ -334,7 +333,7 @@ public class Scoreboards {
|
|||||||
team.setCollisionRule(collisionRule);
|
team.setCollisionRule(collisionRule);
|
||||||
break;
|
break;
|
||||||
case "color":
|
case "color":
|
||||||
if(!modifying) return new StringValue(((PlayerTeam_scarpetMixin) team).getColor().getName());
|
if(!modifying) return new StringValue(team.getColor().getName());
|
||||||
if(!(settingVal instanceof StringValue)) throw new InternalExpressionException("'team_property' requires a string as the third argument for the property " + propertyVal.getString());
|
if(!(settingVal instanceof StringValue)) throw new InternalExpressionException("'team_property' requires a string as the third argument for the property " + propertyVal.getString());
|
||||||
ChatFormatting color = ChatFormatting.getByName(settingVal.getString().toUpperCase());
|
ChatFormatting color = ChatFormatting.getByName(settingVal.getString().toUpperCase());
|
||||||
if(color == null || !color.isColor()) throw new InternalExpressionException("Unknown value for property " + propertyVal.getString() + ": " + settingVal.getString());
|
if(color == null || !color.isColor()) throw new InternalExpressionException("Unknown value for property " + propertyVal.getString() + ": " + settingVal.getString());
|
||||||
|
|||||||
@@ -143,7 +143,6 @@
|
|||||||
"Inventory_scarpetEventMixin",
|
"Inventory_scarpetEventMixin",
|
||||||
"Objective_scarpetMixin",
|
"Objective_scarpetMixin",
|
||||||
"Scoreboard_scarpetMixin",
|
"Scoreboard_scarpetMixin",
|
||||||
"PlayerTeam_scarpetMixin",
|
|
||||||
"MerchantResultSlot_scarpetEventMixin",
|
"MerchantResultSlot_scarpetEventMixin",
|
||||||
"AbstractContainerMenu_scarpetMixin",
|
"AbstractContainerMenu_scarpetMixin",
|
||||||
"AbstractContainerMenuSubclasses_scarpetMixin",
|
"AbstractContainerMenuSubclasses_scarpetMixin",
|
||||||
|
|||||||
Reference in new issue
Block a user