Remove a no longer necessary mixin
And tiny cleanup to another one
This commit is contained in:
4 files changed
+8
-31
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.block.Blocks;
|
||||
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.phys.Vec3;
|
||||
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.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
@@ -22,7 +20,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
@Mixin(PistonMovingBlockEntity.class)
|
||||
public abstract class PistonMovingBlockEntity_playerHandlingMixin
|
||||
{
|
||||
|
||||
@Inject(method = "moveEntityByPiston", at = @At("HEAD"), cancellable = true)
|
||||
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))
|
||||
{
|
||||
Vec3 vec3d = entity.getDeltaMovement();
|
||||
double e = vec3d.x;
|
||||
double f = vec3d.y;
|
||||
double g = vec3d.z;
|
||||
double x = vec3d.x;
|
||||
double y = vec3d.y;
|
||||
double z = vec3d.z;
|
||||
Direction direction = pistonBlockEntity.getMovementDirection();
|
||||
switch (direction.getAxis()) {
|
||||
case X:
|
||||
e = direction.getStepX();
|
||||
break;
|
||||
case Y:
|
||||
f = direction.getStepY();
|
||||
break;
|
||||
case Z:
|
||||
g = direction.getStepZ();
|
||||
case X -> x = direction.getStepX();
|
||||
case Y -> y = direction.getStepY();
|
||||
case Z -> z = direction.getStepZ();
|
||||
}
|
||||
|
||||
entity.setDeltaMovement(e, f, g);
|
||||
entity.setDeltaMovement(x, y, z);
|
||||
}
|
||||
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.Scoreboard_scarpetMixin;
|
||||
import carpet.mixins.PlayerTeam_scarpetMixin;
|
||||
import carpet.script.CarpetContext;
|
||||
import carpet.script.Expression;
|
||||
import carpet.script.exception.InternalExpressionException;
|
||||
@@ -334,7 +333,7 @@ public class Scoreboards {
|
||||
team.setCollisionRule(collisionRule);
|
||||
break;
|
||||
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());
|
||||
ChatFormatting color = ChatFormatting.getByName(settingVal.getString().toUpperCase());
|
||||
if(color == null || !color.isColor()) throw new InternalExpressionException("Unknown value for property " + propertyVal.getString() + ": " + settingVal.getString());
|
||||
|
||||
@@ -143,7 +143,6 @@
|
||||
"Inventory_scarpetEventMixin",
|
||||
"Objective_scarpetMixin",
|
||||
"Scoreboard_scarpetMixin",
|
||||
"PlayerTeam_scarpetMixin",
|
||||
"MerchantResultSlot_scarpetEventMixin",
|
||||
"AbstractContainerMenu_scarpetMixin",
|
||||
"AbstractContainerMenuSubclasses_scarpetMixin",
|
||||
|
||||
Reference in new issue
Block a user