Skip to content

Commit

Permalink
v3.1.18
Browse files Browse the repository at this point in the history
  • Loading branch information
AzureZhen committed Sep 5, 2022
1 parent 41575cb commit cad5ce7
Show file tree
Hide file tree
Showing 32 changed files with 5 additions and 54 deletions.
5 changes: 3 additions & 2 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
3.1.17
3.1.18

- Fixed Extended Entity Render of armor - DerToaster
- Cleaned up Habitat placment check and proper placement.
- Code Clean up
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ loader_version=0.14.9
fabric_version=0.60.0+1.19.2

# Mod Properties
mod_version=3.1.17
mod_version=3.1.18
maven_group=software.bernie.geckolib
archives_base_name=geckolib-fabric-1.19
repsyUrl=https://repo.repsy.io/mvn/gandiber/geckolib
2 changes: 0 additions & 2 deletions src/main/java/software/bernie/example/ClientListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@

public class ClientListener implements ClientModInitializer {

@SuppressWarnings({ "unchecked" })
@Override
public void onInitializeClient() {
if (FabricLoader.getInstance().isDevelopmentEnvironment() && !GeckoLibMod.DISABLE_IN_DEV) {
Expand Down Expand Up @@ -89,7 +88,6 @@ public static void onPacket(MinecraftClient context, PacketByteBuf byteBuf) {
float pitch = (byteBuf.readByte() * 360) / 256.0F;
float yaw = (byteBuf.readByte() * 360) / 256.0F;
context.execute(() -> {
@SuppressWarnings("resource")
ClientWorld world = MinecraftClient.getInstance().world;
Entity entity = type.create(world);
if (entity != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ public Identifier getTextureResource(GeoExampleEntity entity) {
return new Identifier(GeckoLib.ModID, "textures/model/entity/bat.png");
}

@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void setLivingAnimations(GeoExampleEntity entity, Integer uniqueID, AnimationEvent customPredicate) {
super.setLivingAnimations(entity, uniqueID, customPredicate);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import software.bernie.geckolib3.GeckoLib;
import software.bernie.geckolib3.model.AnimatedGeoModel;

@SuppressWarnings("rawtypes")
public class ReplacedCreeperModel extends AnimatedGeoModel {
@Override
public Identifier getModelResource(Object object) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

public class LERenderer extends GeoEntityRenderer<LEEntity> {

@SuppressWarnings("unchecked")
public LERenderer(EntityRendererFactory.Context renderManager) {
super(renderManager, new LEModel());
this.addLayer(new GeoExampleLayer(this));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

public class ReplacedCreeperRenderer extends GeoReplacedEntityRenderer<ReplacedCreeperEntity> {

@SuppressWarnings("unchecked")
public ReplacedCreeperRenderer(EntityRendererFactory.Context ctx) {
super(ctx, new ReplacedCreeperModel(), new ReplacedCreeperEntity());
GeoReplacedEntityRenderer.registerReplacedEntity(ReplacedCreeperEntity.class, this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,16 @@
import software.bernie.geckolib3.renderers.geo.GeoLayerRenderer;
import software.bernie.geckolib3.renderers.geo.IGeoRenderer;

@SuppressWarnings("rawtypes")
public class GeoExampleLayer extends GeoLayerRenderer {
// A resource location for the texture of the layer. This will be applied onto pre-existing cubes on the model
private static final Identifier LAYER = new Identifier(GeckoLib.ModID, "textures/entity/le_glasses.png");
// A resource location for the model of the entity. This model is put on top of the normal one, which is then given the texture
private static final Identifier MODEL = new Identifier(GeckoLib.ModID, "geo/le.geo.json");

@SuppressWarnings("unchecked")
public GeoExampleLayer(IGeoRenderer<?> entityRendererIn) {
super(entityRendererIn);
}

@SuppressWarnings("unchecked")
@Override
public void render(MatrixStack matrixStackIn, VertexConsumerProvider bufferIn, int packedLightIn, Entity entityLivingBaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch) {
RenderLayer cameo = RenderLayer.getArmorCutoutNoCull(LAYER);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ public void registerControllers(AnimationData data) {
data.addAnimationController(controller);
}

@SuppressWarnings("resource")
private <ENTITY extends IAnimatable> void customListener(CustomInstructionKeyframeEvent<ENTITY> event) {
final ClientPlayerEntity player = MinecraftClient.getInstance().player;
if (player != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ private <P extends Item & IAnimatable> PlayState predicate(AnimationEvent<P> eve

@Override
public void registerControllers(AnimationData data) {
@SuppressWarnings({ "unchecked", "rawtypes" })
AnimationController<JackInTheBoxItem> controller = new AnimationController(this, controllerName, 20,
this::predicate);

Expand All @@ -54,7 +53,6 @@ public void registerControllers(AnimationData data) {
data.addAnimationController(controller);
}

@SuppressWarnings("resource")
private <ENTITY extends IAnimatable> void soundListener(SoundKeyframeEvent<ENTITY> event) {
// The animation for the jackinthebox has a sound keyframe at time 0:00.
// As soon as that keyframe gets hit this method fires and it starts playing the
Expand Down Expand Up @@ -82,13 +80,11 @@ public TypedActionResult<ItemStack> use(World world, PlayerEntity user, Hand han
return super.use(world, user, hand);
}

@SuppressWarnings("resource")
@Override
public void onAnimationSync(int id, int state) {
if (state == ANIM_OPEN) {
// Always use GeckoLibUtil to get AnimationControllers when you don't have
// access to an AnimationEvent
@SuppressWarnings("rawtypes")
final AnimationController controller = GeckoLibUtil.getControllerForID(this.factory, id, controllerName);

if (controller.getAnimationState() == AnimationState.Stopped) {
Expand Down
1 change: 0 additions & 1 deletion src/main/java/software/bernie/example/item/PistolItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ public <P extends Item & IAnimatable> PlayState predicate(AnimationEvent<P> even
return PlayState.CONTINUE;
}

@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void registerControllers(AnimationData data) {
data.addAnimationController(new AnimationController(this, controllerName, 1, this::predicate));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ private <P extends IAnimatable> PlayState predicate(AnimationEvent<P> event) {

// All you need to do here is add your animation controllers to the
// AnimationData
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public void registerControllers(AnimationData data) {
data.addAnimationController(new AnimationController(this, "controller", 20, this::predicate));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ public EntityRegistryBuilder<E> dimensions(EntityDimensions size) {
return this;
}

@SuppressWarnings({ "unchecked" })
public EntityType<E> build() {
EntityType.Builder<E> entityBuilder = EntityType.Builder.create(this.entityFactory, this.category)
.setDimensions(this.dimensions.width, this.dimensions.height);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

public class PatchouliCompat {

@SuppressWarnings({ "resource", "unlikely-arg-type" })
public static void patchouliLoaded(MatrixStack matrixStackIn) {
Class<GuiBook> patchouli = GuiBook.class;
boolean screen = MinecraftClient.getInstance().inGameHud.equals(patchouli);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ private JsonObject loadFile(Identifier location, ResourceManager manager) {
return JsonHelper.deserialize(GSON, content, JsonObject.class);
}

@SuppressWarnings("deprecation")
public static String getResourceAsString(Identifier location, ResourceManager manager) {
try (InputStream inputStream = manager.getResourceOrThrow(location).getInputStream()) {
return IOUtils.toString(inputStream);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import net.minecraft.util.Identifier;
import software.bernie.geckolib3.ArmorRenderingRegistryImpl;

@SuppressWarnings("rawtypes")
@Mixin({ ArmorFeatureRenderer.class })
@Environment(EnvType.CLIENT)
public abstract class MixinArmorFeatureRenderer extends FeatureRenderer {
Expand All @@ -40,7 +39,6 @@ public abstract class MixinArmorFeatureRenderer extends FeatureRenderer {
@Unique
private EquipmentSlot gl_storedSlot;

@SuppressWarnings({ "unchecked" })
public MixinArmorFeatureRenderer(FeatureRendererContext context) {
super(context);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@

public abstract class AnimatedGeoModel<T extends IAnimatable> extends GeoModelProvider<T>
implements IAnimatableModel<T>, IAnimatableModelProvider<T> {
@SuppressWarnings("rawtypes")
private final AnimationProcessor animationProcessor;
private GeoModel currentModel;

@SuppressWarnings("rawtypes")
protected AnimatedGeoModel() {
this.animationProcessor = new AnimationProcessor(this);
}
Expand All @@ -46,7 +44,6 @@ public void registerBone(GeoBone bone) {
}
}

@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public void setLivingAnimations(T entity, Integer uniqueID, AnimationEvent customPredicate) {
// Each animation has it's own collection of animations (called the
Expand Down Expand Up @@ -78,7 +75,6 @@ public void setLivingAnimations(T entity, Integer uniqueID, AnimationEvent custo
}
}

@SuppressWarnings("rawtypes")
@Override
public AnimationProcessor getAnimationProcessor() {
return this.animationProcessor;
Expand All @@ -88,7 +84,6 @@ public void registerModelRenderer(IBone modelRenderer) {
animationProcessor.registerModelRenderer(modelRenderer);
}

@SuppressWarnings("unchecked")
@Override
public Animation getAnimation(String name, IAnimatable animatable) {
AnimationFile animation = GeckoLibCache.getInstance().getAnimations()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public boolean isInitialized() {
return !this.getAnimationProcessor().getModelRendererList().isEmpty();
}

@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public void setLivingAnimations(T entity, Integer uniqueID, @Nullable AnimationEvent customPredicate) {
// Each animation has it's own collection of animations (called the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ protected void moveAndRotateMatrixToMatchBone(MatrixStack stack, GeoBone bone) {
stack.multiply(Vec3f.POSITIVE_Z.getDegreesQuaternion(bone.getRotationZ()));
}

@SuppressWarnings("unchecked")
protected void handleArmorRenderingForBone(GeoBone bone, MatrixStack stack, VertexConsumer bufferIn,
int packedLightIn, int packedOverlayIn, Identifier currentTexture) {
final ItemStack armorForBone = this.getArmorForBone(bone.getName(), currentEntityBeingRendered);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import software.bernie.geckolib3.model.AnimatedGeoModel;
import software.bernie.geckolib3.util.GeoUtils;

@SuppressWarnings({ "rawtypes", "unchecked" })
public class GeoArmorRenderer<T extends ArmorItem & IAnimatable> implements IGeoRenderer<T>, ArmorRenderer {
public static final Map<Class<? extends ArmorItem>, GeoArmorRenderer> renderers = new ConcurrentHashMap<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import software.bernie.geckolib3.geo.render.built.GeoModel;
import software.bernie.geckolib3.model.AnimatedGeoModel;

@SuppressWarnings({ "rawtypes", "unchecked" })
public abstract class GeoBlockRenderer<T extends BlockEntity & IAnimatable>
implements IGeoRenderer<T>, BlockEntityRenderer {
static {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
import software.bernie.geckolib3.util.AnimationUtils;
import software.bernie.geckolib3.util.RenderUtils;

@SuppressWarnings("unchecked")
public abstract class GeoEntityRenderer<T extends LivingEntity & IAnimatable> extends EntityRenderer<T>
implements IGeoRenderer<T> {
static {
Expand Down Expand Up @@ -99,7 +98,6 @@ private static float getFacingAngle(Direction facingIn) {
}
}

@SuppressWarnings("resource")
@Override
public void render(T entity, float entityYaw, float partialTicks, MatrixStack stack,
VertexConsumerProvider bufferIn, int packedLightIn) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import software.bernie.geckolib3.model.AnimatedGeoModel;
import software.bernie.geckolib3.util.GeckoLibUtil;

@SuppressWarnings({ "rawtypes", "unchecked" })
public class GeoItemRenderer<T extends Item & IAnimatable>
implements IGeoRenderer<T>, BuiltinItemRendererRegistry.DynamicItemRenderer {
private static final Map<Class<? extends Item>, GeoItemRenderer> renderers = new ConcurrentHashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public RenderLayer getRenderType(Identifier textureLocation) {
return RenderLayer.getEntityCutout(textureLocation);
}

@SuppressWarnings("unchecked")
public GeoModelProvider<T> getEntityModel() {
return this.entityRenderer.getGeoModelProvider();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import software.bernie.geckolib3.model.provider.data.EntityModelData;
import software.bernie.geckolib3.util.AnimationUtils;

@SuppressWarnings("unchecked")
public class GeoProjectilesRenderer<T extends Entity & IAnimatable> extends EntityRenderer<T>
implements IGeoRenderer<T> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import software.bernie.geckolib3.model.AnimatedGeoModel;
import software.bernie.geckolib3.model.provider.data.EntityModelData;

@SuppressWarnings({ "rawtypes", "unchecked" })
public abstract class GeoReplacedEntityRenderer<T extends IAnimatable> extends EntityRenderer implements IGeoRenderer {
private final AnimatedGeoModel<IAnimatable> modelProvider;
private final T animatable;
Expand Down Expand Up @@ -80,7 +79,6 @@ public void render(Entity entityIn, float entityYaw, float partialTicks, MatrixS
this.render(entityIn, this.animatable, entityYaw, partialTicks, matrixStackIn, bufferIn, packedLightIn);
}

@SuppressWarnings({ "resource" })
public void render(Entity entity, IAnimatable animatable, float entityYaw, float partialTicks, MatrixStack stack,
VertexConsumerProvider bufferIn, int packedLightIn) {
this.currentAnimatable = animatable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ default void renderCube(GeoCube cube, MatrixStack stack, VertexConsumer bufferIn
}
}

@SuppressWarnings("rawtypes")
GeoModelProvider getGeoModelProvider();

Identifier getTextureResource(T instance);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,11 @@ public static double convertSecondsToTicks(double seconds) {
/**
* Gets the renderer for an entity
*/
@SuppressWarnings("unchecked")
public static <T extends Entity> EntityRenderer<T> getRenderer(T entity) {
EntityRenderDispatcher renderManager = MinecraftClient.getInstance().getEntityRenderDispatcher();
return (EntityRenderer<T>) renderManager.getRenderer(entity);
}

@SuppressWarnings("rawtypes")
public static <T extends Entity> GeoModelProvider getGeoModelForEntity(T entity) {
EntityRenderer<T> entityRenderer = getRenderer(entity);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,11 @@ public static boolean stackHasIDTag(ItemStack stack) {
return stack.hasNbt() && stack.getNbt().contains(GECKO_LIB_ID_NBT, 3);
}

@SuppressWarnings("rawtypes")
public static AnimationController getControllerForStack(AnimationFactory factory, ItemStack stack,
String controllerName) {
return getControllerForID(factory, getIDFromStack(stack), controllerName);
}

@SuppressWarnings("rawtypes")
public static AnimationController getControllerForID(AnimationFactory factory, Integer id, String controllerName) {
return factory.getOrCreateAnimationData(id).getAnimationControllers().get(controllerName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ public static List<Map.Entry<String, JsonElement>> getBones(JsonObject json) {
* sure why the format stores the times as a string) and the JsonElement
* is the object, which has all the rotation keyframes.
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
public static Set<Map.Entry<String, JsonElement>> getRotationKeyFrames(JsonObject json) {
JsonElement rotationObject = json.get("rotation");
if (rotationObject.isJsonArray()) {
Expand All @@ -90,7 +89,6 @@ public static Set<Map.Entry<String, JsonElement>> getRotationKeyFrames(JsonObjec
* sure why the format stores the times as a string) and the JsonElement
* is the object, which has all the position keyframes.
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
public static Set<Map.Entry<String, JsonElement>> getPositionKeyFrames(JsonObject json) {
JsonElement positionObject = json.get("position");
if (positionObject.isJsonArray()) {
Expand All @@ -113,7 +111,6 @@ public static Set<Map.Entry<String, JsonElement>> getPositionKeyFrames(JsonObjec
* sure why the format stores the times as a string) and the JsonElement
* is the object, which has all the scale keyframes.
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
public static Set<Map.Entry<String, JsonElement>> getScaleKeyFrames(JsonObject json) {
JsonElement scaleObject = json.get("scale");
if (scaleObject.isJsonArray()) {
Expand Down Expand Up @@ -182,7 +179,6 @@ private static JsonElement getObjectByKey(Set<Map.Entry<String, JsonElement>> js
* @return the animation
* @throws ShaderParseException the json exception
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
public static Map.Entry<String, JsonElement> getAnimation(JsonObject animationFile, String animationName)
throws ShaderParseException {
return new AbstractMap.SimpleEntry(animationName, getObjectByKey(getAnimations(animationFile), animationName));
Expand Down Expand Up @@ -213,7 +209,6 @@ public static Set<Map.Entry<String, JsonElement>> getObjectListAsArray(JsonObjec
* @throws IllegalStateException Throws this exception if the JSON is formatted
* incorrectly
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
public static Animation deserializeJsonToAnimation(Map.Entry<String, JsonElement> element, MolangParser parser)
throws ClassCastException, IllegalStateException {
Animation animation = new Animation();
Expand Down Expand Up @@ -316,7 +311,6 @@ private static double calculateLength(List<BoneAnimation> boneAnimations) {
return longestLength == 0 ? Double.MAX_VALUE : longestLength;
}

@SuppressWarnings({ "unchecked" })
static List<IValue> convertJsonArrayToList(JsonArray array) {
return new Gson().fromJson(array, ArrayList.class);
}
Expand Down
Loading

0 comments on commit cad5ce7

Please sign in to comment.