From 0824c1a5ada6259bc4bf8ed44fb692a6b60e54b3 Mon Sep 17 00:00:00 2001 From: i509VCB <30619168+i509VCB@users.noreply.github.com> Date: Fri, 3 Jan 2020 23:57:35 -0600 Subject: [PATCH] Match some more invalid mixins with their still existing targets. (#2459) --- .../dragon/EnderDragonEntityMixin_API.java | 12 ++-- .../EnderDragonPartEntityMixin_API.java} | 14 ++--- .../mcp/state/BooleanPropertyMixin_API.java} | 8 +-- .../mcp/state/EnumPropertyMixin_API.java} | 8 +-- .../mcp/state}/IPropertyMixin_API.java | 21 +++---- .../mcp/state/IntegerPropertyMixin_API.java} | 8 +-- .../mcp/state/PropertyMixin_API.java} | 12 ++-- .../state/BooleanPropertyMixin.java} | 8 +-- .../state/EnumPropertyMixin.java} | 8 +-- .../state/IntegerPropertyMixin.java} | 8 +-- .../state/PropertyMixin.java} | 9 ++- .../TileEntityStructure_ModeMixin_API.java | 60 ------------------- src/main/resources/mixins.common.api.json | 6 ++ src/main/resources/mixins.common.core.json | 4 ++ 14 files changed, 68 insertions(+), 118 deletions(-) rename src/main/java/org/spongepowered/common/mixin/{invalid/api/mcp/entity/MultiPartEntityPartMixin_API.java => api/mcp/entity/boss/dragon/EnderDragonPartEntityMixin_API.java} (79%) rename src/main/java/org/spongepowered/common/mixin/{invalid/api/mcp/block/properties/PropertyBooleanMixin_API.java => api/mcp/state/BooleanPropertyMixin_API.java} (82%) rename src/main/java/org/spongepowered/common/mixin/{invalid/api/mcp/block/properties/PropertyEnumMixin_API.java => api/mcp/state/EnumPropertyMixin_API.java} (82%) rename src/main/java/org/spongepowered/common/mixin/{invalid/api/mcp/block/properties => api/mcp/state}/IPropertyMixin_API.java (82%) rename src/main/java/org/spongepowered/common/mixin/{invalid/api/mcp/block/properties/PropertyIntegerMixin_API.java => api/mcp/state/IntegerPropertyMixin_API.java} (82%) rename src/main/java/org/spongepowered/common/mixin/{invalid/api/mcp/block/properties/PropertyHelperMixin_API.java => api/mcp/state/PropertyMixin_API.java} (86%) rename src/main/java/org/spongepowered/common/mixin/{invalid/core/block/properties/PropertyBooleanMixin.java => core/state/BooleanPropertyMixin.java} (89%) rename src/main/java/org/spongepowered/common/mixin/{invalid/core/block/properties/PropertyEnumMixin.java => core/state/EnumPropertyMixin.java} (90%) rename src/main/java/org/spongepowered/common/mixin/{invalid/core/block/properties/PropertyIntegerMixin.java => core/state/IntegerPropertyMixin.java} (89%) rename src/main/java/org/spongepowered/common/mixin/{invalid/core/block/properties/PropertyHelperMixin.java => core/state/PropertyMixin.java} (89%) delete mode 100644 src/main/java/org/spongepowered/common/mixin/invalid/api/mcp/tileentity/TileEntityStructure_ModeMixin_API.java diff --git a/src/main/java/org/spongepowered/common/mixin/api/mcp/entity/boss/dragon/EnderDragonEntityMixin_API.java b/src/main/java/org/spongepowered/common/mixin/api/mcp/entity/boss/dragon/EnderDragonEntityMixin_API.java index 96fc3d630d0..c32c773acf1 100644 --- a/src/main/java/org/spongepowered/common/mixin/api/mcp/entity/boss/dragon/EnderDragonEntityMixin_API.java +++ b/src/main/java/org/spongepowered/common/mixin/api/mcp/entity/boss/dragon/EnderDragonEntityMixin_API.java @@ -26,8 +26,8 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet.Builder; -import net.minecraft.entity.MultiPartEntityPart; import net.minecraft.entity.boss.dragon.EnderDragonEntity; +import net.minecraft.entity.boss.dragon.EnderDragonPartEntity; import net.minecraft.entity.boss.dragon.phase.PhaseManager; import net.minecraft.entity.item.EnderCrystalEntity; import net.minecraft.world.end.DragonFightManager; @@ -48,16 +48,16 @@ @Mixin(EnderDragonEntity.class) public abstract class EnderDragonEntityMixin_API extends MobEntityMixin_API implements EnderDragon { - @Shadow public MultiPartEntityPart[] dragonPartArray; - @Shadow public EnderCrystalEntity healingEnderCrystal; - @Final @Shadow private DragonFightManager fightManager; + @Shadow public EnderDragonPartEntity[] dragonParts; + @Shadow public EnderCrystalEntity closestEnderCrystal; + @Shadow @Final private DragonFightManager fightManager; @Shadow @Final private PhaseManager phaseManager; @Override public Set getParts() { Builder builder = ImmutableSet.builder(); - for (MultiPartEntityPart part : this.dragonPartArray) { + for (EnderDragonPartEntity part : this.dragonParts) { builder.add((EnderDragonPart) part); } @@ -66,7 +66,7 @@ public Set getParts() { @Override public Optional getHealingCrystal() { - return Optional.ofNullable((EnderCrystal) this.healingEnderCrystal); + return Optional.ofNullable((EnderCrystal) this.closestEnderCrystal); } diff --git a/src/main/java/org/spongepowered/common/mixin/invalid/api/mcp/entity/MultiPartEntityPartMixin_API.java b/src/main/java/org/spongepowered/common/mixin/api/mcp/entity/boss/dragon/EnderDragonPartEntityMixin_API.java similarity index 79% rename from src/main/java/org/spongepowered/common/mixin/invalid/api/mcp/entity/MultiPartEntityPartMixin_API.java rename to src/main/java/org/spongepowered/common/mixin/api/mcp/entity/boss/dragon/EnderDragonPartEntityMixin_API.java index 45e1fd191fc..59ba565fb01 100644 --- a/src/main/java/org/spongepowered/common/mixin/invalid/api/mcp/entity/MultiPartEntityPartMixin_API.java +++ b/src/main/java/org/spongepowered/common/mixin/api/mcp/entity/boss/dragon/EnderDragonPartEntityMixin_API.java @@ -22,10 +22,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package org.spongepowered.common.mixin.invalid.api.mcp.entity; +package org.spongepowered.common.mixin.api.mcp.entity.boss.dragon; -import net.minecraft.entity.IEntityMultiPart; -import net.minecraft.entity.MultiPartEntityPart; +import net.minecraft.entity.boss.dragon.EnderDragonEntity; +import net.minecraft.entity.boss.dragon.EnderDragonPartEntity; import org.spongepowered.api.entity.living.monster.boss.dragon.EnderDragon; import org.spongepowered.api.entity.living.monster.boss.dragon.EnderDragonPart; import org.spongepowered.asm.mixin.Final; @@ -33,14 +33,14 @@ import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.common.mixin.api.mcp.entity.EntityMixin_API; -@Mixin(MultiPartEntityPart.class) -public abstract class MultiPartEntityPartMixin_API extends EntityMixin_API implements EnderDragonPart { +@Mixin(EnderDragonPartEntity.class) +public abstract class EnderDragonPartEntityMixin_API extends EntityMixin_API implements EnderDragonPart { - @Shadow @Final public IEntityMultiPart parent; + @Shadow @Final public EnderDragonEntity dragon; @Override public EnderDragon getParent() { - return (EnderDragon) this.parent; + return (EnderDragon) this.dragon; } } diff --git a/src/main/java/org/spongepowered/common/mixin/invalid/api/mcp/block/properties/PropertyBooleanMixin_API.java b/src/main/java/org/spongepowered/common/mixin/api/mcp/state/BooleanPropertyMixin_API.java similarity index 82% rename from src/main/java/org/spongepowered/common/mixin/invalid/api/mcp/block/properties/PropertyBooleanMixin_API.java rename to src/main/java/org/spongepowered/common/mixin/api/mcp/state/BooleanPropertyMixin_API.java index 665aa18e409..ea3906e4588 100644 --- a/src/main/java/org/spongepowered/common/mixin/invalid/api/mcp/block/properties/PropertyBooleanMixin_API.java +++ b/src/main/java/org/spongepowered/common/mixin/api/mcp/state/BooleanPropertyMixin_API.java @@ -22,13 +22,13 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package org.spongepowered.common.mixin.invalid.api.mcp.block.properties; +package org.spongepowered.common.mixin.api.mcp.state; -import net.minecraft.block.properties.PropertyBool; +import net.minecraft.state.BooleanProperty; import org.spongepowered.api.state.BooleanStateProperty; import org.spongepowered.asm.mixin.Mixin; -@Mixin(value = PropertyBool.class) -public abstract class PropertyBooleanMixin_API extends PropertyHelperMixin_API implements BooleanStateProperty { +@Mixin(value = BooleanProperty.class) +public abstract class BooleanPropertyMixin_API extends PropertyMixin_API implements BooleanStateProperty { } diff --git a/src/main/java/org/spongepowered/common/mixin/invalid/api/mcp/block/properties/PropertyEnumMixin_API.java b/src/main/java/org/spongepowered/common/mixin/api/mcp/state/EnumPropertyMixin_API.java similarity index 82% rename from src/main/java/org/spongepowered/common/mixin/invalid/api/mcp/block/properties/PropertyEnumMixin_API.java rename to src/main/java/org/spongepowered/common/mixin/api/mcp/state/EnumPropertyMixin_API.java index d93f8486e58..5d162d6f074 100644 --- a/src/main/java/org/spongepowered/common/mixin/invalid/api/mcp/block/properties/PropertyEnumMixin_API.java +++ b/src/main/java/org/spongepowered/common/mixin/api/mcp/state/EnumPropertyMixin_API.java @@ -22,13 +22,13 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package org.spongepowered.common.mixin.invalid.api.mcp.block.properties; +package org.spongepowered.common.mixin.api.mcp.state; -import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.state.EnumProperty; import org.spongepowered.api.state.EnumStateProperty; import org.spongepowered.asm.mixin.Mixin; -@Mixin(value = PropertyEnum.class) -public abstract class PropertyEnumMixin_API> extends PropertyHelperMixin_API implements EnumStateProperty { +@Mixin(value = EnumProperty.class) +public abstract class EnumPropertyMixin_API> extends PropertyMixin_API implements EnumStateProperty { } diff --git a/src/main/java/org/spongepowered/common/mixin/invalid/api/mcp/block/properties/IPropertyMixin_API.java b/src/main/java/org/spongepowered/common/mixin/api/mcp/state/IPropertyMixin_API.java similarity index 82% rename from src/main/java/org/spongepowered/common/mixin/invalid/api/mcp/block/properties/IPropertyMixin_API.java rename to src/main/java/org/spongepowered/common/mixin/api/mcp/state/IPropertyMixin_API.java index b57fcedcd8d..3b1cd8fc495 100644 --- a/src/main/java/org/spongepowered/common/mixin/invalid/api/mcp/block/properties/IPropertyMixin_API.java +++ b/src/main/java/org/spongepowered/common/mixin/api/mcp/state/IPropertyMixin_API.java @@ -22,9 +22,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package org.spongepowered.common.mixin.invalid.api.mcp.block.properties; +package org.spongepowered.common.mixin.api.mcp.state; -import net.minecraft.block.properties.IProperty; +import net.minecraft.state.IProperty; +import org.spongepowered.api.CatalogKey; import org.spongepowered.api.state.StateProperty; import org.spongepowered.api.util.Functional; import org.spongepowered.asm.mixin.Implements; @@ -48,33 +49,33 @@ * @param The type of comparable. */ @Mixin(value = IProperty.class) -@Implements(@Interface(iface = StateProperty.class, prefix = "trait$")) +@Implements(@Interface(iface = StateProperty.class, prefix = "state$")) public interface IPropertyMixin_API> extends IProperty { - default String trait$getId() { + default CatalogKey state$getKey() { return BlockTypeRegistryModule.getInstance().getIdFor(this); } @Intrinsic - default String trait$getName() { + default String state$getName() { return getName(); } - default Collection trait$getPossibleValues() { + default Collection state$getPossibleValues() { return getAllowedValues(); } @Intrinsic - default Class trait$getValueClass() { + default Class state$getValueClass() { return getValueClass(); } - default Predicate trait$getPredicate() { + default Predicate state$getPredicate() { return Functional.predicateIn(getAllowedValues()); } @Intrinsic - default Optional trait$parseValue(final String value) { - return parseValue(value).toJavaUtil(); + default Optional state$parseValue(final String value) { + return parseValue(value); } } diff --git a/src/main/java/org/spongepowered/common/mixin/invalid/api/mcp/block/properties/PropertyIntegerMixin_API.java b/src/main/java/org/spongepowered/common/mixin/api/mcp/state/IntegerPropertyMixin_API.java similarity index 82% rename from src/main/java/org/spongepowered/common/mixin/invalid/api/mcp/block/properties/PropertyIntegerMixin_API.java rename to src/main/java/org/spongepowered/common/mixin/api/mcp/state/IntegerPropertyMixin_API.java index d01828426c4..48789b4898b 100644 --- a/src/main/java/org/spongepowered/common/mixin/invalid/api/mcp/block/properties/PropertyIntegerMixin_API.java +++ b/src/main/java/org/spongepowered/common/mixin/api/mcp/state/IntegerPropertyMixin_API.java @@ -22,13 +22,13 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package org.spongepowered.common.mixin.invalid.api.mcp.block.properties; +package org.spongepowered.common.mixin.api.mcp.state; -import net.minecraft.block.properties.PropertyInteger; +import net.minecraft.state.IntegerProperty; import org.spongepowered.api.state.IntegerStateProperty; import org.spongepowered.asm.mixin.Mixin; -@Mixin(value = PropertyInteger.class) -public abstract class PropertyIntegerMixin_API extends PropertyHelperMixin_API implements IntegerStateProperty { +@Mixin(value = IntegerProperty.class) +public abstract class IntegerPropertyMixin_API extends PropertyMixin_API implements IntegerStateProperty { } diff --git a/src/main/java/org/spongepowered/common/mixin/invalid/api/mcp/block/properties/PropertyHelperMixin_API.java b/src/main/java/org/spongepowered/common/mixin/api/mcp/state/PropertyMixin_API.java similarity index 86% rename from src/main/java/org/spongepowered/common/mixin/invalid/api/mcp/block/properties/PropertyHelperMixin_API.java rename to src/main/java/org/spongepowered/common/mixin/api/mcp/state/PropertyMixin_API.java index f8a97202649..2eccbddcfb2 100644 --- a/src/main/java/org/spongepowered/common/mixin/invalid/api/mcp/block/properties/PropertyHelperMixin_API.java +++ b/src/main/java/org/spongepowered/common/mixin/api/mcp/state/PropertyMixin_API.java @@ -22,10 +22,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package org.spongepowered.common.mixin.invalid.api.mcp.block.properties; +package org.spongepowered.common.mixin.api.mcp.state; -import net.minecraft.block.properties.AbstractProperty; -import net.minecraft.block.properties.IProperty; +import net.minecraft.state.IProperty; +import net.minecraft.state.Property; import org.spongepowered.api.state.StateProperty; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.common.registry.provider.BlockPropertyIdProvider; @@ -40,8 +40,8 @@ * * @param The type of comparable */ -@Mixin(value = AbstractProperty.class) -public abstract class PropertyHelperMixin_API> implements StateProperty { +@Mixin(value = Property.class) +public abstract class PropertyMixin_API> implements StateProperty { @Nullable private String api$IdString = null; @@ -49,7 +49,7 @@ public abstract class PropertyHelperMixin_API> implement @Override public String getId() { if (this.api$IdString == null) { - this.api$IdString = BlockPropertyIdProvider.getIdFor((IProperty) this); + this.api$IdString = BlockPropertyIdProvider.getIdFor((IProperty) this); } return this.api$IdString; } diff --git a/src/main/java/org/spongepowered/common/mixin/invalid/core/block/properties/PropertyBooleanMixin.java b/src/main/java/org/spongepowered/common/mixin/core/state/BooleanPropertyMixin.java similarity index 89% rename from src/main/java/org/spongepowered/common/mixin/invalid/core/block/properties/PropertyBooleanMixin.java rename to src/main/java/org/spongepowered/common/mixin/core/state/BooleanPropertyMixin.java index 6a11f484749..992ed854e7a 100644 --- a/src/main/java/org/spongepowered/common/mixin/invalid/core/block/properties/PropertyBooleanMixin.java +++ b/src/main/java/org/spongepowered/common/mixin/core/state/BooleanPropertyMixin.java @@ -22,10 +22,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package org.spongepowered.common.mixin.invalid.core.block.properties; +package org.spongepowered.common.mixin.core.state; import com.google.common.collect.ImmutableSet; -import net.minecraft.block.properties.PropertyBool; +import net.minecraft.state.BooleanProperty; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Overwrite; @@ -33,8 +33,8 @@ import javax.annotation.Nullable; -@Mixin(value = PropertyBool.class) -public abstract class PropertyBooleanMixin extends PropertyHelperMixin { +@Mixin(value = BooleanProperty.class) +public abstract class BooleanPropertyMixin extends PropertyMixin { @Shadow @Final private ImmutableSet allowedValues; diff --git a/src/main/java/org/spongepowered/common/mixin/invalid/core/block/properties/PropertyEnumMixin.java b/src/main/java/org/spongepowered/common/mixin/core/state/EnumPropertyMixin.java similarity index 90% rename from src/main/java/org/spongepowered/common/mixin/invalid/core/block/properties/PropertyEnumMixin.java rename to src/main/java/org/spongepowered/common/mixin/core/state/EnumPropertyMixin.java index 512994f1754..8b887bcccf9 100644 --- a/src/main/java/org/spongepowered/common/mixin/invalid/core/block/properties/PropertyEnumMixin.java +++ b/src/main/java/org/spongepowered/common/mixin/core/state/EnumPropertyMixin.java @@ -22,10 +22,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package org.spongepowered.common.mixin.invalid.core.block.properties; +package org.spongepowered.common.mixin.core.state; import com.google.common.collect.ImmutableSet; -import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.state.EnumProperty; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Overwrite; @@ -35,8 +35,8 @@ import javax.annotation.Nullable; -@Mixin(value = PropertyEnum.class) -public abstract class PropertyEnumMixin> extends PropertyHelperMixin { +@Mixin(value = EnumProperty.class) +public abstract class EnumPropertyMixin> extends PropertyMixin { @Shadow @Final private ImmutableSet allowedValues; @Shadow @Final private Map nameToValue; diff --git a/src/main/java/org/spongepowered/common/mixin/invalid/core/block/properties/PropertyIntegerMixin.java b/src/main/java/org/spongepowered/common/mixin/core/state/IntegerPropertyMixin.java similarity index 89% rename from src/main/java/org/spongepowered/common/mixin/invalid/core/block/properties/PropertyIntegerMixin.java rename to src/main/java/org/spongepowered/common/mixin/core/state/IntegerPropertyMixin.java index 4bccf97a4ad..d1ae4a38cc3 100644 --- a/src/main/java/org/spongepowered/common/mixin/invalid/core/block/properties/PropertyIntegerMixin.java +++ b/src/main/java/org/spongepowered/common/mixin/core/state/IntegerPropertyMixin.java @@ -22,10 +22,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package org.spongepowered.common.mixin.invalid.core.block.properties; +package org.spongepowered.common.mixin.core.state; import com.google.common.collect.ImmutableSet; -import net.minecraft.block.properties.PropertyInteger; +import net.minecraft.state.IntegerProperty; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Overwrite; @@ -33,8 +33,8 @@ import javax.annotation.Nullable; -@Mixin(value = PropertyInteger.class) -public abstract class PropertyIntegerMixin extends PropertyHelperMixin { +@Mixin(value = IntegerProperty.class) +public abstract class IntegerPropertyMixin extends PropertyMixin { @Shadow @Final private ImmutableSet allowedValues; diff --git a/src/main/java/org/spongepowered/common/mixin/invalid/core/block/properties/PropertyHelperMixin.java b/src/main/java/org/spongepowered/common/mixin/core/state/PropertyMixin.java similarity index 89% rename from src/main/java/org/spongepowered/common/mixin/invalid/core/block/properties/PropertyHelperMixin.java rename to src/main/java/org/spongepowered/common/mixin/core/state/PropertyMixin.java index a45935c6d27..cd9d2c5ece0 100644 --- a/src/main/java/org/spongepowered/common/mixin/invalid/core/block/properties/PropertyHelperMixin.java +++ b/src/main/java/org/spongepowered/common/mixin/core/state/PropertyMixin.java @@ -22,10 +22,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package org.spongepowered.common.mixin.invalid.core.block.properties; +package org.spongepowered.common.mixin.core.state; -import net.minecraft.block.properties.AbstractProperty; -import net.minecraft.block.properties.IProperty; +import net.minecraft.state.Property; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Overwrite; @@ -39,8 +38,8 @@ * * @param The type of comparable */ -@Mixin(value = AbstractProperty.class) -public abstract class PropertyHelperMixin> { +@Mixin(value = Property.class) +public abstract class PropertyMixin> { @Shadow @Final private Class valueClass; @Shadow @Final private String name; diff --git a/src/main/java/org/spongepowered/common/mixin/invalid/api/mcp/tileentity/TileEntityStructure_ModeMixin_API.java b/src/main/java/org/spongepowered/common/mixin/invalid/api/mcp/tileentity/TileEntityStructure_ModeMixin_API.java deleted file mode 100644 index 482e8581fbc..00000000000 --- a/src/main/java/org/spongepowered/common/mixin/invalid/api/mcp/tileentity/TileEntityStructure_ModeMixin_API.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * This file is part of Sponge, licensed under the MIT License (MIT). - * - * Copyright (c) SpongePowered - * Copyright (c) contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.spongepowered.common.mixin.invalid.api.mcp.tileentity; - -import org.spongepowered.api.data.type.StructureMode; -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Implements; -import org.spongepowered.asm.mixin.Interface; -import org.spongepowered.asm.mixin.Intrinsic; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; - -import java.util.Locale; - -import javax.annotation.Nullable; -import net.minecraft.tileentity.StructureBlockTileEntity; - -@Mixin(StructureBlockTileEntity.Mode.class) -@Implements(@Interface(iface = StructureMode.class, prefix = "structure$")) -public abstract class TileEntityStructure_ModeMixin_API implements StructureMode { - - @Shadow @Final private String modeName; - @Nullable private String friendlyName; - - @Override - public String getId() { - return this.modeName; - } - - @Intrinsic - public String structure$getName() { - if (this.friendlyName == null) { - this.friendlyName = this.modeName.toUpperCase(Locale.ENGLISH); - } - return this.friendlyName; - } - -} diff --git a/src/main/resources/mixins.common.api.json b/src/main/resources/mixins.common.api.json index a99a976e68c..1c3466515d2 100644 --- a/src/main/resources/mixins.common.api.json +++ b/src/main/resources/mixins.common.api.json @@ -49,6 +49,7 @@ "mcp.entity.ai.goal.RandomWalkingGoalMixin_API", "mcp.entity.ai.goal.LookAtGoalMixin_API", "mcp.entity.boss.dragon.EnderDragonEntityMixin_API", + "mcp.entity.boss.dragon.EnderDragonPartEntityMixin_API", "mcp.entity.boss.WitherEntityMixin_API", "mcp.entity.boss.dragon.phase.IPhaseMixin_API", "mcp.entity.boss.dragon.phase.PhaseTypeMixin_API", @@ -177,6 +178,11 @@ "mcp.server.management.BanEntryMixin_API", "mcp.server.management.UserListEntryMixin_API", "mcp.server.management.IPBanEntryMixin_API", + "mcp.state.BooleanPropertyMixin_API", + "mcp.state.EnumPropertyMixin_API", + "mcp.state.IntegerPropertyMixin_API", + "mcp.state.IPropertyMixin_API", + "mcp.state.PropertyMixin_API", "mcp.state.properties.DoorHingeSideMixin_API", "mcp.stats.StatMixin_API", "mcp.tileentity.BannerPatternMixin_API", diff --git a/src/main/resources/mixins.common.core.json b/src/main/resources/mixins.common.core.json index e54c33b375e..2227c71b35c 100644 --- a/src/main/resources/mixins.common.core.json +++ b/src/main/resources/mixins.common.core.json @@ -153,6 +153,10 @@ "network.login.ServerLoginNetHandler_2Mixin", "network.login.ServerLoginNetHandlerMixin", "service.permission.SubjectMixin", + "state.BooleanPropertyMixin", + "state.EnumPropertyMixin", + "state.IntegerPropertyMixin", + "state.PropertyMixin", "stats.StatMixin", "stats.StatisticsManagerMixin", "stats.StatsMixin",