diff --git a/src/main/java/com/minelittlepony/unicopia/util/AwaitTickQueue.java b/src/main/java/com/minelittlepony/unicopia/AwaitTickQueue.java similarity index 94% rename from src/main/java/com/minelittlepony/unicopia/util/AwaitTickQueue.java rename to src/main/java/com/minelittlepony/unicopia/AwaitTickQueue.java index dda90f08..d0ee0b7a 100644 --- a/src/main/java/com/minelittlepony/unicopia/util/AwaitTickQueue.java +++ b/src/main/java/com/minelittlepony/unicopia/AwaitTickQueue.java @@ -1,4 +1,4 @@ -package com.minelittlepony.unicopia.util; +package com.minelittlepony.unicopia; import java.util.List; import java.util.Queue; @@ -7,7 +7,6 @@ import java.util.stream.Collectors; import com.google.common.collect.Lists; import com.google.common.collect.Queues; -import com.minelittlepony.unicopia.UnicopiaCore; import net.minecraft.world.World; diff --git a/src/main/java/com/minelittlepony/unicopia/CustomDrops.java b/src/main/java/com/minelittlepony/unicopia/CustomDrops.java index fcae8b03..a63fa2ba 100644 --- a/src/main/java/com/minelittlepony/unicopia/CustomDrops.java +++ b/src/main/java/com/minelittlepony/unicopia/CustomDrops.java @@ -2,6 +2,7 @@ package com.minelittlepony.unicopia; import java.util.List; +import com.minelittlepony.unicopia.block.UBlocks; import com.minelittlepony.unicopia.item.UItems; import com.minelittlepony.unicopia.magic.spell.SpellRegistry; diff --git a/src/main/java/com/minelittlepony/unicopia/IKeyBinding.java b/src/main/java/com/minelittlepony/unicopia/KeyBind.java similarity index 79% rename from src/main/java/com/minelittlepony/unicopia/IKeyBinding.java rename to src/main/java/com/minelittlepony/unicopia/KeyBind.java index f79bbe4b..b635ec58 100644 --- a/src/main/java/com/minelittlepony/unicopia/IKeyBinding.java +++ b/src/main/java/com/minelittlepony/unicopia/KeyBind.java @@ -1,6 +1,6 @@ package com.minelittlepony.unicopia; -public interface IKeyBinding { +public interface KeyBind { String getKeyCategory(); String getKeyName(); diff --git a/src/main/java/com/minelittlepony/unicopia/UnicopiaCore.java b/src/main/java/com/minelittlepony/unicopia/UnicopiaCore.java index 945ab958..5c1f28f1 100644 --- a/src/main/java/com/minelittlepony/unicopia/UnicopiaCore.java +++ b/src/main/java/com/minelittlepony/unicopia/UnicopiaCore.java @@ -11,7 +11,9 @@ import com.minelittlepony.common.util.GamePaths; import com.minelittlepony.jumpingcastle.api.Channel; import com.minelittlepony.jumpingcastle.api.JumpingCastle; import com.minelittlepony.unicopia.ability.Abilities; +import com.minelittlepony.unicopia.block.UBlocks; import com.minelittlepony.unicopia.command.Commands; +import com.minelittlepony.unicopia.container.UContainers; import com.minelittlepony.unicopia.enchanting.Pages; import com.minelittlepony.unicopia.enchanting.recipe.AffineIngredients; import com.minelittlepony.unicopia.item.UItems; diff --git a/src/main/java/com/minelittlepony/unicopia/ability/Ability.java b/src/main/java/com/minelittlepony/unicopia/ability/Ability.java index 0db330b0..82db9179 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/Ability.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/Ability.java @@ -3,14 +3,14 @@ package com.minelittlepony.unicopia.ability; import javax.annotation.Nullable; import com.google.gson.annotations.Expose; -import com.minelittlepony.unicopia.IKeyBinding; +import com.minelittlepony.unicopia.KeyBind; import com.minelittlepony.unicopia.Race; import com.minelittlepony.unicopia.entity.player.Pony; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -public interface Ability extends IKeyBinding { +public interface Ability extends KeyBind { @Override default String getKeyCategory() { diff --git a/src/main/java/com/minelittlepony/unicopia/ability/ChangelingDisguiseAbility.java b/src/main/java/com/minelittlepony/unicopia/ability/ChangelingDisguiseAbility.java index 91ac2450..68fb37c6 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/ChangelingDisguiseAbility.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/ChangelingDisguiseAbility.java @@ -6,11 +6,11 @@ import javax.annotation.Nullable; import org.lwjgl.glfw.GLFW; import com.minelittlepony.unicopia.Race; -import com.minelittlepony.unicopia.UParticles; import com.minelittlepony.unicopia.entity.InAnimate; import com.minelittlepony.unicopia.entity.player.Pony; import com.minelittlepony.unicopia.magic.spell.DisguiseSpell; import com.minelittlepony.unicopia.util.VecHelper; +import com.minelittlepony.unicopia.util.particles.UParticles; import net.minecraft.block.BlockState; import net.minecraft.entity.Entity; diff --git a/src/main/java/com/minelittlepony/unicopia/ability/EarthPonyGrowAbility.java b/src/main/java/com/minelittlepony/unicopia/ability/EarthPonyGrowAbility.java index bd13dcf3..b866bd52 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/EarthPonyGrowAbility.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/EarthPonyGrowAbility.java @@ -3,9 +3,9 @@ package com.minelittlepony.unicopia.ability; import org.lwjgl.glfw.GLFW; import com.minelittlepony.unicopia.Race; -import com.minelittlepony.unicopia.UParticles; import com.minelittlepony.unicopia.entity.player.Pony; import com.minelittlepony.unicopia.util.VecHelper; +import com.minelittlepony.unicopia.util.particles.UParticles; import net.minecraft.block.BlockState; import net.minecraft.item.BoneMealItem; diff --git a/src/main/java/com/minelittlepony/unicopia/ability/EarthPonyStompAbility.java b/src/main/java/com/minelittlepony/unicopia/ability/EarthPonyStompAbility.java index e8cf8d4a..c3b20862 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/EarthPonyStompAbility.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/EarthPonyStompAbility.java @@ -6,10 +6,10 @@ import org.lwjgl.glfw.GLFW; import com.google.common.collect.Lists; import com.google.gson.annotations.Expose; +import com.minelittlepony.unicopia.AwaitTickQueue; import com.minelittlepony.unicopia.Race; import com.minelittlepony.unicopia.entity.player.Pony; import com.minelittlepony.unicopia.item.AppleItem; -import com.minelittlepony.unicopia.util.AwaitTickQueue; import com.minelittlepony.unicopia.util.MagicalDamageSource; import com.minelittlepony.unicopia.util.PosHelper; import com.minelittlepony.unicopia.util.VecHelper; diff --git a/src/main/java/com/minelittlepony/unicopia/ability/PegasusCloudInteractionAbility.java b/src/main/java/com/minelittlepony/unicopia/ability/PegasusCloudInteractionAbility.java index 5d30383c..4fafa4e0 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/PegasusCloudInteractionAbility.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/PegasusCloudInteractionAbility.java @@ -5,9 +5,9 @@ import java.util.Optional; import org.lwjgl.glfw.GLFW; import com.minelittlepony.unicopia.Race; -import com.minelittlepony.unicopia.UParticles; import com.minelittlepony.unicopia.entity.player.Pony; import com.minelittlepony.unicopia.util.VecHelper; +import com.minelittlepony.unicopia.util.particles.UParticles; import net.minecraft.entity.Entity; diff --git a/src/main/java/com/minelittlepony/unicopia/ability/UnicornCastingAbility.java b/src/main/java/com/minelittlepony/unicopia/ability/UnicornCastingAbility.java index d7a12fa4..d2053913 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/UnicornCastingAbility.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/UnicornCastingAbility.java @@ -3,9 +3,9 @@ package com.minelittlepony.unicopia.ability; import org.lwjgl.glfw.GLFW; import com.minelittlepony.unicopia.Race; -import com.minelittlepony.unicopia.UParticles; import com.minelittlepony.unicopia.entity.player.Pony; import com.minelittlepony.unicopia.magic.spell.ShieldSpell; +import com.minelittlepony.unicopia.util.particles.UParticles; /** * A magic casting ability for unicorns. diff --git a/src/main/java/com/minelittlepony/unicopia/ability/UnicornTeleportAbility.java b/src/main/java/com/minelittlepony/unicopia/ability/UnicornTeleportAbility.java index e7c8af89..deec704c 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/UnicornTeleportAbility.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/UnicornTeleportAbility.java @@ -3,9 +3,9 @@ package com.minelittlepony.unicopia.ability; import org.lwjgl.glfw.GLFW; import com.minelittlepony.unicopia.Race; -import com.minelittlepony.unicopia.UParticles; import com.minelittlepony.unicopia.entity.player.Pony; import com.minelittlepony.unicopia.util.VecHelper; +import com.minelittlepony.unicopia.util.particles.UParticles; import net.minecraft.block.Block; import net.minecraft.block.BlockState; diff --git a/src/main/java/com/minelittlepony/unicopia/block/BlockGrowingCuccoon.java b/src/main/java/com/minelittlepony/unicopia/block/BlockGrowingCuccoon.java index cb16025a..aa162128 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/BlockGrowingCuccoon.java +++ b/src/main/java/com/minelittlepony/unicopia/block/BlockGrowingCuccoon.java @@ -6,8 +6,6 @@ import java.util.Random; import javax.annotation.Nullable; import com.minelittlepony.unicopia.EquinePredicates; -import com.minelittlepony.unicopia.UBlocks; -import com.minelittlepony.unicopia.UMaterials; import com.minelittlepony.unicopia.USounds; import com.minelittlepony.unicopia.util.MagicalDamageSource; import com.minelittlepony.unicopia.util.PosHelper; diff --git a/src/main/java/com/minelittlepony/unicopia/block/ChiselledChitinBlock.java b/src/main/java/com/minelittlepony/unicopia/block/ChiselledChitinBlock.java index a3fa71bb..3f937b95 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/ChiselledChitinBlock.java +++ b/src/main/java/com/minelittlepony/unicopia/block/ChiselledChitinBlock.java @@ -3,7 +3,6 @@ package com.minelittlepony.unicopia.block; import javax.annotation.Nullable; import com.minelittlepony.unicopia.Race; -import com.minelittlepony.unicopia.UMaterials; import com.minelittlepony.unicopia.entity.player.Pony; import net.fabricmc.fabric.api.block.FabricBlockSettings; diff --git a/src/main/java/com/minelittlepony/unicopia/block/ChitinBlock.java b/src/main/java/com/minelittlepony/unicopia/block/ChitinBlock.java index 7cde8028..9716d175 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/ChitinBlock.java +++ b/src/main/java/com/minelittlepony/unicopia/block/ChitinBlock.java @@ -1,7 +1,6 @@ package com.minelittlepony.unicopia.block; import com.minelittlepony.unicopia.Race; -import com.minelittlepony.unicopia.UMaterials; import com.minelittlepony.unicopia.entity.player.Pony; import net.fabricmc.fabric.api.block.FabricBlockSettings; diff --git a/src/main/java/com/minelittlepony/unicopia/block/GlowingGemBlock.java b/src/main/java/com/minelittlepony/unicopia/block/GlowingGemBlock.java index 272984a6..c9d5a3c6 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/GlowingGemBlock.java +++ b/src/main/java/com/minelittlepony/unicopia/block/GlowingGemBlock.java @@ -2,9 +2,9 @@ package com.minelittlepony.unicopia.block; import java.util.Random; -import com.minelittlepony.unicopia.CloudType; -import com.minelittlepony.unicopia.UParticles; +import com.minelittlepony.unicopia.gas.CloudType; import com.minelittlepony.unicopia.gas.Gas; +import com.minelittlepony.unicopia.util.particles.UParticles; import net.fabricmc.fabric.api.block.FabricBlockSettings; import net.minecraft.block.Block; diff --git a/src/main/java/com/minelittlepony/unicopia/block/HiveWallBlock.java b/src/main/java/com/minelittlepony/unicopia/block/HiveWallBlock.java index 85f217d1..7c16a8eb 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/HiveWallBlock.java +++ b/src/main/java/com/minelittlepony/unicopia/block/HiveWallBlock.java @@ -5,8 +5,6 @@ import java.util.Random; import com.google.common.collect.Maps; import com.minelittlepony.unicopia.Race; -import com.minelittlepony.unicopia.UBlocks; -import com.minelittlepony.unicopia.UMaterials; import com.minelittlepony.unicopia.USounds; import com.minelittlepony.unicopia.entity.player.Pony; import com.minelittlepony.unicopia.util.PosHelper; diff --git a/src/main/java/com/minelittlepony/unicopia/block/TomatoPlantBlock.java b/src/main/java/com/minelittlepony/unicopia/block/TomatoPlantBlock.java index 5b3e88bb..019fab89 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/TomatoPlantBlock.java +++ b/src/main/java/com/minelittlepony/unicopia/block/TomatoPlantBlock.java @@ -1,7 +1,7 @@ package com.minelittlepony.unicopia.block; import java.util.List; -import com.minelittlepony.unicopia.UBlocks; + import com.minelittlepony.unicopia.gas.CloudFarmlandBlock; import com.minelittlepony.unicopia.item.UItems; diff --git a/src/main/java/com/minelittlepony/unicopia/UBlocks.java b/src/main/java/com/minelittlepony/unicopia/block/UBlocks.java similarity index 84% rename from src/main/java/com/minelittlepony/unicopia/UBlocks.java rename to src/main/java/com/minelittlepony/unicopia/block/UBlocks.java index 5c5e6bcc..3f87a349 100644 --- a/src/main/java/com/minelittlepony/unicopia/UBlocks.java +++ b/src/main/java/com/minelittlepony/unicopia/block/UBlocks.java @@ -1,7 +1,6 @@ -package com.minelittlepony.unicopia; +package com.minelittlepony.unicopia.block; -import com.minelittlepony.unicopia.block.BlockGrowingCuccoon; -import com.minelittlepony.unicopia.block.TomatoPlantBlock; +import com.minelittlepony.unicopia.UnicopiaCore; import com.minelittlepony.unicopia.gas.CloudAnvilBlock; import com.minelittlepony.unicopia.gas.CloudBlock; import com.minelittlepony.unicopia.gas.CloudDoorBlock; @@ -9,17 +8,7 @@ import com.minelittlepony.unicopia.gas.CloudFarmlandBlock; import com.minelittlepony.unicopia.gas.CloudFenceBlock; import com.minelittlepony.unicopia.gas.CloudSlabBlock; import com.minelittlepony.unicopia.gas.CloudStairsBlock; -import com.minelittlepony.unicopia.block.ChiselledChitinBlock; -import com.minelittlepony.unicopia.block.ChitinBlock; -import com.minelittlepony.unicopia.block.DiamondDoorBlock; -import com.minelittlepony.unicopia.block.DutchDoorBlock; -import com.minelittlepony.unicopia.block.FruitLeavesBlock; -import com.minelittlepony.unicopia.block.GlowingGemBlock; -import com.minelittlepony.unicopia.block.HiveWallBlock; -import com.minelittlepony.unicopia.block.SlimeLayerBlock; -import com.minelittlepony.unicopia.block.StickBlock; -import com.minelittlepony.unicopia.block.SugarBlock; -import com.minelittlepony.unicopia.block.TallCropBlock; +import com.minelittlepony.unicopia.gas.CloudType; import com.minelittlepony.unicopia.item.AppleItem; import com.minelittlepony.unicopia.item.UItems; import com.minelittlepony.unicopia.structure.CustomSaplingGenerator; diff --git a/src/main/java/com/minelittlepony/unicopia/UMaterials.java b/src/main/java/com/minelittlepony/unicopia/block/UMaterials.java similarity index 85% rename from src/main/java/com/minelittlepony/unicopia/UMaterials.java rename to src/main/java/com/minelittlepony/unicopia/block/UMaterials.java index 28d09b8f..86d561d1 100644 --- a/src/main/java/com/minelittlepony/unicopia/UMaterials.java +++ b/src/main/java/com/minelittlepony/unicopia/block/UMaterials.java @@ -1,4 +1,4 @@ -package com.minelittlepony.unicopia; +package com.minelittlepony.unicopia.block; import net.minecraft.block.Material; import net.minecraft.block.MaterialColor; diff --git a/src/main/java/com/minelittlepony/unicopia/client/KeyBindingsHandler.java b/src/main/java/com/minelittlepony/unicopia/client/KeyBindingsHandler.java index 55c4906b..488c8ef2 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/KeyBindingsHandler.java +++ b/src/main/java/com/minelittlepony/unicopia/client/KeyBindingsHandler.java @@ -3,7 +3,7 @@ package com.minelittlepony.unicopia.client; import java.util.HashSet; import java.util.Set; -import com.minelittlepony.unicopia.IKeyBinding; +import com.minelittlepony.unicopia.KeyBind; import com.minelittlepony.unicopia.UnicopiaCore; import com.minelittlepony.unicopia.ability.Abilities; import com.minelittlepony.unicopia.entity.player.Pony; @@ -24,7 +24,7 @@ class KeyBindingsHandler { private final Set pressed = new HashSet<>(); - public void addKeybind(IKeyBinding p) { + public void addKeybind(KeyBind p) { KeyBindingRegistry.INSTANCE.addCategory(p.getKeyCategory()); FabricKeyBinding b = FabricKeyBinding.Builder.create(new Identifier(UnicopiaCore.MODID, p.getKeyName()), InputUtil.Type.KEYSYM, p.getKeyCode(), p.getKeyCategory()).build(); diff --git a/src/main/java/com/minelittlepony/unicopia/util/MineLPConnector.java b/src/main/java/com/minelittlepony/unicopia/client/MineLPConnector.java similarity index 97% rename from src/main/java/com/minelittlepony/unicopia/util/MineLPConnector.java rename to src/main/java/com/minelittlepony/unicopia/client/MineLPConnector.java index 7991f9c0..062bb4ef 100644 --- a/src/main/java/com/minelittlepony/unicopia/util/MineLPConnector.java +++ b/src/main/java/com/minelittlepony/unicopia/client/MineLPConnector.java @@ -1,4 +1,4 @@ -package com.minelittlepony.unicopia.util; +package com.minelittlepony.unicopia.client; import com.minelittlepony.unicopia.Race; diff --git a/src/main/java/com/minelittlepony/unicopia/client/UnicopiaCoreClient.java b/src/main/java/com/minelittlepony/unicopia/client/UnicopiaCoreClient.java index 3ae9c86f..85210c57 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/UnicopiaCoreClient.java +++ b/src/main/java/com/minelittlepony/unicopia/client/UnicopiaCoreClient.java @@ -10,16 +10,15 @@ import com.minelittlepony.jumpingcastle.api.Target; import com.minelittlepony.unicopia.Config; import com.minelittlepony.unicopia.InteractionManager; import com.minelittlepony.unicopia.Race; -import com.minelittlepony.unicopia.UBlocks; import com.minelittlepony.unicopia.UnicopiaCore; import com.minelittlepony.unicopia.ability.Abilities; +import com.minelittlepony.unicopia.block.UBlocks; import com.minelittlepony.unicopia.client.render.DisguiseRenderer; import com.minelittlepony.unicopia.ducks.Colourful; import com.minelittlepony.unicopia.entity.player.Pony; import com.minelittlepony.unicopia.item.UItems; import com.minelittlepony.unicopia.magic.spell.SpellRegistry; import com.minelittlepony.unicopia.network.MsgRequestCapabilities; -import com.minelittlepony.unicopia.util.MineLPConnector; import com.minelittlepony.unicopia.util.dummy.DummyClientPlayerEntity; import com.mojang.authlib.GameProfile; import com.mojang.blaze3d.platform.GlStateManager; diff --git a/src/main/java/com/minelittlepony/unicopia/client/render/model/GemEntityModel.java b/src/main/java/com/minelittlepony/unicopia/client/render/model/GemEntityModel.java index 80cb006a..ac7a8a43 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/render/model/GemEntityModel.java +++ b/src/main/java/com/minelittlepony/unicopia/client/render/model/GemEntityModel.java @@ -2,7 +2,7 @@ package com.minelittlepony.unicopia.client.render.model; import com.minelittlepony.unicopia.client.render.ModelQuads; import com.minelittlepony.unicopia.entity.SpellcastEntity; -import com.minelittlepony.util.Color; +import com.minelittlepony.unicopia.util.Color; import com.mojang.blaze3d.platform.GLX; import com.mojang.blaze3d.platform.GlStateManager; diff --git a/src/main/java/com/minelittlepony/unicopia/container/BagOfHoldingInventory.java b/src/main/java/com/minelittlepony/unicopia/container/BagOfHoldingInventory.java index 2db64f46..e528c86e 100644 --- a/src/main/java/com/minelittlepony/unicopia/container/BagOfHoldingInventory.java +++ b/src/main/java/com/minelittlepony/unicopia/container/BagOfHoldingInventory.java @@ -7,7 +7,6 @@ import java.util.function.BiFunction; import com.minelittlepony.unicopia.UTags; import com.minelittlepony.unicopia.advancement.BOHDeathCriterion; -import com.minelittlepony.unicopia.util.HeavyInventoryUtils; import com.minelittlepony.unicopia.util.NbtSerialisable; import com.minelittlepony.unicopia.util.MagicalDamageSource; @@ -113,7 +112,7 @@ public class BagOfHoldingInventory extends BasicInventory implements NbtSerialis } } - HeavyInventoryUtils.encodeStackWeight(blockStack, HeavyInventoryUtils.getContentsTotalWorth(blockInventory, true), true); + HeavyInventory.encodeStackWeight(blockStack, HeavyInventory.getContentsTotalWorth(blockInventory, true), true); world.removeBlockEntity(pos); world.setBlockState(pos, Blocks.AIR.getDefaultState()); @@ -181,7 +180,7 @@ public class BagOfHoldingInventory extends BasicInventory implements NbtSerialis } public double getContentsTotalWorth() { - return HeavyInventoryUtils.getContentsTotalWorth(this, true); + return HeavyInventory.getContentsTotalWorth(this, true); } public void writeTostack(ItemStack stack) { diff --git a/src/main/java/com/minelittlepony/unicopia/util/HeavyInventoryUtils.java b/src/main/java/com/minelittlepony/unicopia/container/HeavyInventory.java similarity index 97% rename from src/main/java/com/minelittlepony/unicopia/util/HeavyInventoryUtils.java rename to src/main/java/com/minelittlepony/unicopia/container/HeavyInventory.java index 1c72a914..4b8459f3 100644 --- a/src/main/java/com/minelittlepony/unicopia/util/HeavyInventoryUtils.java +++ b/src/main/java/com/minelittlepony/unicopia/container/HeavyInventory.java @@ -1,4 +1,4 @@ -package com.minelittlepony.unicopia.util; +package com.minelittlepony.unicopia.container; import net.minecraft.block.Block; import net.minecraft.block.BlockEntityProvider; @@ -8,7 +8,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.EmptyBlockView; -public class HeavyInventoryUtils { +public class HeavyInventory { public static double getContentsTotalWorth(Inventory inventory, boolean deep) { double total = 0; diff --git a/src/main/java/com/minelittlepony/unicopia/container/SpellBookContainer.java b/src/main/java/com/minelittlepony/unicopia/container/SpellBookContainer.java index 4b024af7..6ad124bc 100644 --- a/src/main/java/com/minelittlepony/unicopia/container/SpellBookContainer.java +++ b/src/main/java/com/minelittlepony/unicopia/container/SpellBookContainer.java @@ -2,11 +2,11 @@ package com.minelittlepony.unicopia.container; import javax.annotation.Nonnull; +import com.minelittlepony.unicopia.AwaitTickQueue; import com.minelittlepony.unicopia.EquinePredicates; import com.minelittlepony.unicopia.enchanting.IPageUnlockListener; import com.minelittlepony.unicopia.entity.player.Pony; import com.minelittlepony.unicopia.magic.spell.SpellRegistry; -import com.minelittlepony.unicopia.util.AwaitTickQueue; import net.minecraft.container.Container; import net.minecraft.container.Slot; diff --git a/src/main/java/com/minelittlepony/unicopia/UContainers.java b/src/main/java/com/minelittlepony/unicopia/container/UContainers.java similarity index 76% rename from src/main/java/com/minelittlepony/unicopia/UContainers.java rename to src/main/java/com/minelittlepony/unicopia/container/UContainers.java index d0e6b8e4..9aa359eb 100644 --- a/src/main/java/com/minelittlepony/unicopia/UContainers.java +++ b/src/main/java/com/minelittlepony/unicopia/container/UContainers.java @@ -1,7 +1,6 @@ -package com.minelittlepony.unicopia; +package com.minelittlepony.unicopia.container; -import com.minelittlepony.unicopia.container.BagOfHoldingContainer; -import com.minelittlepony.unicopia.container.SpellBookContainer; +import com.minelittlepony.unicopia.UnicopiaCore; import net.fabricmc.fabric.api.container.ContainerProviderRegistry; import net.minecraft.util.Identifier; diff --git a/src/main/java/com/minelittlepony/unicopia/entity/CloudEntity.java b/src/main/java/com/minelittlepony/unicopia/entity/CloudEntity.java index 71f03259..bc253916 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/CloudEntity.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/CloudEntity.java @@ -6,12 +6,12 @@ import javax.annotation.Nullable; import com.minelittlepony.unicopia.EquinePredicates; import com.minelittlepony.unicopia.Race; -import com.minelittlepony.unicopia.UBlocks; -import com.minelittlepony.unicopia.UParticles; import com.minelittlepony.unicopia.ability.PegasusCloudInteractionAbility.ICloudEntity; +import com.minelittlepony.unicopia.block.UBlocks; import com.minelittlepony.unicopia.entity.player.Pony; import com.minelittlepony.unicopia.item.UItems; import com.minelittlepony.unicopia.util.particles.ParticleEmitter; +import com.minelittlepony.unicopia.util.particles.UParticles; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; diff --git a/src/main/java/com/minelittlepony/unicopia/entity/CuccoonEntity.java b/src/main/java/com/minelittlepony/unicopia/entity/CuccoonEntity.java index 1a5a064e..6ae83aaf 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/CuccoonEntity.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/CuccoonEntity.java @@ -7,10 +7,10 @@ import javax.annotation.Nullable; import com.google.common.collect.Lists; import com.minelittlepony.unicopia.EquinePredicates; import com.minelittlepony.unicopia.Race; -import com.minelittlepony.unicopia.UParticles; import com.minelittlepony.unicopia.USounds; import com.minelittlepony.unicopia.entity.player.Pony; import com.minelittlepony.unicopia.util.MagicalDamageSource; +import com.minelittlepony.unicopia.util.particles.UParticles; import net.minecraft.block.Blocks; import net.minecraft.entity.Entity; diff --git a/src/main/java/com/minelittlepony/unicopia/entity/RainbowEntity.java b/src/main/java/com/minelittlepony/unicopia/entity/RainbowEntity.java index 3cb2b6fb..043142cf 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/RainbowEntity.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/RainbowEntity.java @@ -1,7 +1,6 @@ package com.minelittlepony.unicopia.entity; import com.minelittlepony.unicopia.Race; -import com.minelittlepony.unicopia.UEntities; import net.minecraft.client.MinecraftClient; import net.minecraft.client.network.packet.EntitySpawnGlobalS2CPacket; diff --git a/src/main/java/com/minelittlepony/unicopia/UEntities.java b/src/main/java/com/minelittlepony/unicopia/entity/UEntities.java similarity index 73% rename from src/main/java/com/minelittlepony/unicopia/UEntities.java rename to src/main/java/com/minelittlepony/unicopia/entity/UEntities.java index a4528eaa..3b1b7822 100644 --- a/src/main/java/com/minelittlepony/unicopia/UEntities.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/UEntities.java @@ -1,17 +1,6 @@ -package com.minelittlepony.unicopia; +package com.minelittlepony.unicopia.entity; -import com.minelittlepony.unicopia.entity.ButterflyEntity; -import com.minelittlepony.unicopia.entity.CloudEntity; -import com.minelittlepony.unicopia.entity.ConstructionCloudEntity; -import com.minelittlepony.unicopia.entity.CuccoonEntity; -import com.minelittlepony.unicopia.entity.ProjectileEntity; -import com.minelittlepony.unicopia.entity.RacingCloudEntity; -import com.minelittlepony.unicopia.entity.RainbowEntity; -import com.minelittlepony.unicopia.entity.SpearEntity; -import com.minelittlepony.unicopia.entity.SpellbookEntity; -import com.minelittlepony.unicopia.entity.SpellcastEntity; -import com.minelittlepony.unicopia.entity.WildCloudEntity; -import com.minelittlepony.unicopia.util.collection.ListHelper; +import java.util.List; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityCategory; @@ -55,16 +44,22 @@ public interface UEntities { static void bootstrap() { Registry.BIOME.forEach(biome -> { if (!(biome instanceof NetherBiome || biome instanceof EndBiome)) { - ListHelper.addifAbsent(biome.getEntitySpawnList(EntityCategory.AMBIENT), biome instanceof OceanBiome ? WildCloudEntity.SPAWN_ENTRY_OCEAN : WildCloudEntity.SPAWN_ENTRY_LAND); - ListHelper.addifAbsent(biome.getEntitySpawnList(EntityCategory.CREATURE), RainbowEntity.SPAWN_ENTRY); + addifAbsent(biome.getEntitySpawnList(EntityCategory.AMBIENT), biome instanceof OceanBiome ? WildCloudEntity.SPAWN_ENTRY_OCEAN : WildCloudEntity.SPAWN_ENTRY_LAND); + addifAbsent(biome.getEntitySpawnList(EntityCategory.CREATURE), RainbowEntity.SPAWN_ENTRY); } if (biome instanceof PlainsBiome || biome instanceof RiverBiome || biome instanceof MountainsBiome || biome instanceof ForestBiome) { - ListHelper.addifAbsent(biome.getEntitySpawnList(EntityCategory.AMBIENT), ButterflyEntity.SPAWN_ENTRY); + addifAbsent(biome.getEntitySpawnList(EntityCategory.AMBIENT), ButterflyEntity.SPAWN_ENTRY); } }); } + + static void addifAbsent(List entries, T entry) { + if (!entries.contains(entry)) { + entries.add(entry); + } + } } diff --git a/src/main/java/com/minelittlepony/unicopia/entity/WildCloudEntity.java b/src/main/java/com/minelittlepony/unicopia/entity/WildCloudEntity.java index 78c026bb..7e60e819 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/WildCloudEntity.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/WildCloudEntity.java @@ -4,8 +4,6 @@ import java.util.Iterator; import javax.annotation.Nullable; -import com.minelittlepony.unicopia.UEntities; - import net.minecraft.entity.Entity; import net.minecraft.entity.EntityData; import net.minecraft.entity.EntityType; diff --git a/src/main/java/com/minelittlepony/unicopia/entity/player/GravityDelegate.java b/src/main/java/com/minelittlepony/unicopia/entity/player/GravityDelegate.java index 7cdac83a..800062f3 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/player/GravityDelegate.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/player/GravityDelegate.java @@ -3,7 +3,6 @@ package com.minelittlepony.unicopia.entity.player; import java.util.Random; import com.minelittlepony.unicopia.Race; -import com.minelittlepony.unicopia.UParticles; import com.minelittlepony.unicopia.USounds; import com.minelittlepony.unicopia.ability.FlightPredicate; import com.minelittlepony.unicopia.ability.HeightPredicate; @@ -12,6 +11,7 @@ import com.minelittlepony.unicopia.entity.Updatable; import com.minelittlepony.unicopia.magic.MagicEffect; import com.minelittlepony.unicopia.mixin.MixinEntity; import com.minelittlepony.unicopia.util.NbtSerialisable; +import com.minelittlepony.unicopia.util.particles.UParticles; import com.minelittlepony.unicopia.util.MutableVector; import net.minecraft.entity.Entity; diff --git a/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerAttributes.java b/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerAttributes.java index 0531613e..4262d1d3 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerAttributes.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerAttributes.java @@ -3,8 +3,8 @@ package com.minelittlepony.unicopia.entity.player; import java.util.UUID; import com.minelittlepony.unicopia.Race; +import com.minelittlepony.unicopia.container.HeavyInventory; import com.minelittlepony.unicopia.mixin.Walker; -import com.minelittlepony.unicopia.util.HeavyInventoryUtils; import net.minecraft.entity.attribute.EntityAttribute; import net.minecraft.entity.attribute.EntityAttributeInstance; @@ -25,7 +25,7 @@ public class PlayerAttributes { private double loadStrength = 0; public void applyAttributes(PlayerEntity entity, Race race) { - loadStrength = HeavyInventoryUtils.getContentsTotalWorth(entity.inventory, false); + loadStrength = HeavyInventory.getContentsTotalWorth(entity.inventory, false); ((Walker)entity.abilities).setWalkSpeed(0.1F - (float)(loadStrength / 100000)); diff --git a/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerCamera.java b/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerCamera.java index 2c40682f..643e448b 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerCamera.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerCamera.java @@ -1,6 +1,6 @@ package com.minelittlepony.unicopia.entity.player; -import com.minelittlepony.util.MotionCompositor; +import com.minelittlepony.unicopia.util.MotionCompositor; import net.minecraft.util.math.Vec3d; diff --git a/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerImpl.java b/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerImpl.java index af0e4f96..d6af7c72 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerImpl.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerImpl.java @@ -3,13 +3,13 @@ package com.minelittlepony.unicopia.entity.player; import javax.annotation.Nullable; import com.minelittlepony.unicopia.Race; -import com.minelittlepony.unicopia.UEffects; import com.minelittlepony.unicopia.UTags; import com.minelittlepony.unicopia.UnicopiaCore; import com.minelittlepony.unicopia.ability.AbilityReceiver; import com.minelittlepony.unicopia.enchanting.PageOwner; import com.minelittlepony.unicopia.entity.FlightControl; import com.minelittlepony.unicopia.entity.Trap; +import com.minelittlepony.unicopia.item.UEffects; import com.minelittlepony.unicopia.magic.Affinity; import com.minelittlepony.unicopia.magic.AttachedMagicEffect; import com.minelittlepony.unicopia.magic.HeldMagicEffect; @@ -18,8 +18,8 @@ import com.minelittlepony.unicopia.magic.MagicalItem; import com.minelittlepony.unicopia.magic.spell.SpellRegistry; import com.minelittlepony.unicopia.network.EffectSync; import com.minelittlepony.unicopia.network.MsgPlayerCapabilities; -import com.minelittlepony.util.BasicEasingInterpolator; -import com.minelittlepony.util.IInterpolator; +import com.minelittlepony.unicopia.util.BasicEasingInterpolator; +import com.minelittlepony.unicopia.util.IInterpolator; import com.mojang.datafixers.util.Either; import net.minecraft.client.network.packet.EntityPassengersSetS2CPacket; diff --git a/src/main/java/com/minelittlepony/unicopia/entity/player/Pony.java b/src/main/java/com/minelittlepony/unicopia/entity/player/Pony.java index 0154858c..bf5a6c49 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/player/Pony.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/player/Pony.java @@ -11,7 +11,7 @@ import com.minelittlepony.unicopia.entity.RaceContainer; import com.minelittlepony.unicopia.magic.Caster; import com.minelittlepony.unicopia.magic.HeldMagicEffect; import com.minelittlepony.unicopia.network.Transmittable; -import com.minelittlepony.util.IInterpolator; +import com.minelittlepony.unicopia.util.IInterpolator; import com.mojang.authlib.GameProfile; import com.mojang.datafixers.util.Either; diff --git a/src/main/java/com/minelittlepony/unicopia/gas/CloudAnvilBlock.java b/src/main/java/com/minelittlepony/unicopia/gas/CloudAnvilBlock.java index 6a83f33f..c3066ae4 100644 --- a/src/main/java/com/minelittlepony/unicopia/gas/CloudAnvilBlock.java +++ b/src/main/java/com/minelittlepony/unicopia/gas/CloudAnvilBlock.java @@ -2,7 +2,6 @@ package com.minelittlepony.unicopia.gas; import java.util.Random; -import com.minelittlepony.unicopia.CloudType; import com.minelittlepony.unicopia.util.WorldEvent; import net.fabricmc.fabric.api.block.FabricBlockSettings; diff --git a/src/main/java/com/minelittlepony/unicopia/gas/CloudBlock.java b/src/main/java/com/minelittlepony/unicopia/gas/CloudBlock.java index 57a3513f..5f3d6d6d 100644 --- a/src/main/java/com/minelittlepony/unicopia/gas/CloudBlock.java +++ b/src/main/java/com/minelittlepony/unicopia/gas/CloudBlock.java @@ -2,8 +2,7 @@ package com.minelittlepony.unicopia.gas; import java.util.Random; -import com.minelittlepony.unicopia.CloudType; -import com.minelittlepony.unicopia.UBlocks; +import com.minelittlepony.unicopia.block.UBlocks; import com.minelittlepony.unicopia.entity.player.Pony; import com.minelittlepony.unicopia.item.MossItem; import com.minelittlepony.unicopia.util.HoeUtil; diff --git a/src/main/java/com/minelittlepony/unicopia/gas/CloudDoorBlock.java b/src/main/java/com/minelittlepony/unicopia/gas/CloudDoorBlock.java index 427f2943..06dc4c0f 100644 --- a/src/main/java/com/minelittlepony/unicopia/gas/CloudDoorBlock.java +++ b/src/main/java/com/minelittlepony/unicopia/gas/CloudDoorBlock.java @@ -1,8 +1,7 @@ package com.minelittlepony.unicopia.gas; -import com.minelittlepony.unicopia.CloudType; -import com.minelittlepony.unicopia.UMaterials; import com.minelittlepony.unicopia.block.AbstractDoorBlock; +import com.minelittlepony.unicopia.block.UMaterials; import net.fabricmc.fabric.api.block.FabricBlockSettings; import net.minecraft.block.BlockRenderLayer; diff --git a/src/main/java/com/minelittlepony/unicopia/gas/CloudFarmlandBlock.java b/src/main/java/com/minelittlepony/unicopia/gas/CloudFarmlandBlock.java index 93623479..1ee677b9 100644 --- a/src/main/java/com/minelittlepony/unicopia/gas/CloudFarmlandBlock.java +++ b/src/main/java/com/minelittlepony/unicopia/gas/CloudFarmlandBlock.java @@ -1,7 +1,6 @@ package com.minelittlepony.unicopia.gas; -import com.minelittlepony.unicopia.CloudType; -import com.minelittlepony.unicopia.UBlocks; +import com.minelittlepony.unicopia.block.UBlocks; import com.minelittlepony.unicopia.ducks.Farmland; import net.minecraft.block.BlockRenderLayer; diff --git a/src/main/java/com/minelittlepony/unicopia/gas/CloudFenceBlock.java b/src/main/java/com/minelittlepony/unicopia/gas/CloudFenceBlock.java index 9d751de6..0fd9d2e0 100644 --- a/src/main/java/com/minelittlepony/unicopia/gas/CloudFenceBlock.java +++ b/src/main/java/com/minelittlepony/unicopia/gas/CloudFenceBlock.java @@ -1,7 +1,5 @@ package com.minelittlepony.unicopia.gas; -import com.minelittlepony.unicopia.CloudType; - import net.fabricmc.fabric.api.block.FabricBlockSettings; import net.minecraft.block.BlockRenderLayer; import net.minecraft.block.BlockState; diff --git a/src/main/java/com/minelittlepony/unicopia/gas/CloudSlabBlock.java b/src/main/java/com/minelittlepony/unicopia/gas/CloudSlabBlock.java index 246f2a05..bef9aade 100644 --- a/src/main/java/com/minelittlepony/unicopia/gas/CloudSlabBlock.java +++ b/src/main/java/com/minelittlepony/unicopia/gas/CloudSlabBlock.java @@ -1,6 +1,5 @@ package com.minelittlepony.unicopia.gas; -import com.minelittlepony.unicopia.CloudType; import com.minelittlepony.unicopia.block.USlab; import net.fabricmc.fabric.api.block.FabricBlockSettings; diff --git a/src/main/java/com/minelittlepony/unicopia/gas/CloudStairsBlock.java b/src/main/java/com/minelittlepony/unicopia/gas/CloudStairsBlock.java index 2304a4ae..923cd951 100644 --- a/src/main/java/com/minelittlepony/unicopia/gas/CloudStairsBlock.java +++ b/src/main/java/com/minelittlepony/unicopia/gas/CloudStairsBlock.java @@ -1,6 +1,5 @@ package com.minelittlepony.unicopia.gas; -import com.minelittlepony.unicopia.CloudType; import com.minelittlepony.unicopia.block.UStairs; import net.minecraft.block.Block; diff --git a/src/main/java/com/minelittlepony/unicopia/CloudType.java b/src/main/java/com/minelittlepony/unicopia/gas/CloudType.java similarity index 91% rename from src/main/java/com/minelittlepony/unicopia/CloudType.java rename to src/main/java/com/minelittlepony/unicopia/gas/CloudType.java index 9237eade..9e2d164e 100644 --- a/src/main/java/com/minelittlepony/unicopia/CloudType.java +++ b/src/main/java/com/minelittlepony/unicopia/gas/CloudType.java @@ -1,5 +1,6 @@ -package com.minelittlepony.unicopia; +package com.minelittlepony.unicopia.gas; +import com.minelittlepony.unicopia.EquinePredicates; import com.minelittlepony.unicopia.entity.CloudEntity; import net.minecraft.entity.Entity; diff --git a/src/main/java/com/minelittlepony/unicopia/gas/Gas.java b/src/main/java/com/minelittlepony/unicopia/gas/Gas.java index 3e9fe08b..35e5cc56 100644 --- a/src/main/java/com/minelittlepony/unicopia/gas/Gas.java +++ b/src/main/java/com/minelittlepony/unicopia/gas/Gas.java @@ -1,6 +1,5 @@ package com.minelittlepony.unicopia.gas; -import com.minelittlepony.unicopia.CloudType; import com.minelittlepony.unicopia.EquinePredicates; import net.minecraft.block.BedBlock; diff --git a/src/main/java/com/minelittlepony/unicopia/item/AlicornAmuletItem.java b/src/main/java/com/minelittlepony/unicopia/item/AlicornAmuletItem.java index a5eabfd6..191b0763 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/AlicornAmuletItem.java +++ b/src/main/java/com/minelittlepony/unicopia/item/AlicornAmuletItem.java @@ -6,12 +6,12 @@ import java.util.UUID; import javax.annotation.Nullable; import com.google.common.collect.Multimap; +import com.minelittlepony.unicopia.AwaitTickQueue; import com.minelittlepony.unicopia.ducks.IItemEntity; import com.minelittlepony.unicopia.entity.ItemEntityCapabilities; import com.minelittlepony.unicopia.entity.player.Pony; import com.minelittlepony.unicopia.magic.Affinity; import com.minelittlepony.unicopia.magic.AddictiveMagicalItem; -import com.minelittlepony.unicopia.util.AwaitTickQueue; import com.minelittlepony.unicopia.util.MagicalDamageSource; import com.minelittlepony.unicopia.util.VecHelper; diff --git a/src/main/java/com/minelittlepony/unicopia/item/BagOfHoldingItem.java b/src/main/java/com/minelittlepony/unicopia/item/BagOfHoldingItem.java index 081d9cef..e54da728 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/BagOfHoldingItem.java +++ b/src/main/java/com/minelittlepony/unicopia/item/BagOfHoldingItem.java @@ -6,9 +6,9 @@ import java.util.Map; import javax.annotation.Nullable; import com.minelittlepony.unicopia.EquinePredicates; -import com.minelittlepony.unicopia.UContainers; import com.minelittlepony.unicopia.container.BagOfHoldingContainer; import com.minelittlepony.unicopia.container.BagOfHoldingInventory; +import com.minelittlepony.unicopia.container.UContainers; import com.minelittlepony.unicopia.magic.Affinity; import com.minelittlepony.unicopia.magic.MagicalItem; import com.minelittlepony.unicopia.util.VecHelper; diff --git a/src/main/java/com/minelittlepony/unicopia/item/SpellbookItem.java b/src/main/java/com/minelittlepony/unicopia/item/SpellbookItem.java index f6b16f08..395c2a95 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/SpellbookItem.java +++ b/src/main/java/com/minelittlepony/unicopia/item/SpellbookItem.java @@ -3,8 +3,8 @@ package com.minelittlepony.unicopia.item; import javax.annotation.Nullable; import com.minelittlepony.unicopia.EquinePredicates; -import com.minelittlepony.unicopia.UEntities; import com.minelittlepony.unicopia.entity.SpellbookEntity; +import com.minelittlepony.unicopia.entity.UEntities; import com.minelittlepony.unicopia.magic.Dispensable; import net.minecraft.block.DispenserBlock; diff --git a/src/main/java/com/minelittlepony/unicopia/item/StickItem.java b/src/main/java/com/minelittlepony/unicopia/item/StickItem.java index 6888f657..e614c88c 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/StickItem.java +++ b/src/main/java/com/minelittlepony/unicopia/item/StickItem.java @@ -2,7 +2,7 @@ package com.minelittlepony.unicopia.item; import javax.annotation.Nullable; -import com.minelittlepony.unicopia.UBlocks; +import com.minelittlepony.unicopia.block.UBlocks; import net.minecraft.advancement.criterion.Criterions; import net.minecraft.entity.player.PlayerEntity; diff --git a/src/main/java/com/minelittlepony/unicopia/item/TomatoSeedsItem.java b/src/main/java/com/minelittlepony/unicopia/item/TomatoSeedsItem.java index 4843b11e..d5030f4c 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/TomatoSeedsItem.java +++ b/src/main/java/com/minelittlepony/unicopia/item/TomatoSeedsItem.java @@ -1,7 +1,7 @@ package com.minelittlepony.unicopia.item; -import com.minelittlepony.unicopia.UBlocks; import com.minelittlepony.unicopia.block.StickBlock; +import com.minelittlepony.unicopia.block.UBlocks; import net.minecraft.block.Block; import net.minecraft.block.BlockState; diff --git a/src/main/java/com/minelittlepony/unicopia/UEffects.java b/src/main/java/com/minelittlepony/unicopia/item/UEffects.java similarity index 92% rename from src/main/java/com/minelittlepony/unicopia/UEffects.java rename to src/main/java/com/minelittlepony/unicopia/item/UEffects.java index 593ec0dc..033daa87 100644 --- a/src/main/java/com/minelittlepony/unicopia/UEffects.java +++ b/src/main/java/com/minelittlepony/unicopia/item/UEffects.java @@ -1,5 +1,6 @@ -package com.minelittlepony.unicopia; +package com.minelittlepony.unicopia.item; +import com.minelittlepony.unicopia.UnicopiaCore; import com.minelittlepony.unicopia.util.CustomStatusEffect; import com.minelittlepony.unicopia.util.MagicalDamageSource; diff --git a/src/main/java/com/minelittlepony/unicopia/item/UItems.java b/src/main/java/com/minelittlepony/unicopia/item/UItems.java index d23cbd25..2ff14605 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/UItems.java +++ b/src/main/java/com/minelittlepony/unicopia/item/UItems.java @@ -2,9 +2,9 @@ package com.minelittlepony.unicopia.item; import static com.minelittlepony.unicopia.EquinePredicates.*; -import com.minelittlepony.unicopia.UBlocks; -import com.minelittlepony.unicopia.UEntities; import com.minelittlepony.unicopia.USounds; +import com.minelittlepony.unicopia.block.UBlocks; +import com.minelittlepony.unicopia.entity.UEntities; import com.minelittlepony.unicopia.magic.spell.ScorchSpell; import com.minelittlepony.unicopia.toxin.DynamicToxicBlockItem; import com.minelittlepony.unicopia.toxin.DynamicToxicItem; diff --git a/src/main/java/com/minelittlepony/unicopia/magic/spell/AttractiveSpell.java b/src/main/java/com/minelittlepony/unicopia/magic/spell/AttractiveSpell.java index 17332cf3..dd9dc002 100644 --- a/src/main/java/com/minelittlepony/unicopia/magic/spell/AttractiveSpell.java +++ b/src/main/java/com/minelittlepony/unicopia/magic/spell/AttractiveSpell.java @@ -1,10 +1,10 @@ package com.minelittlepony.unicopia.magic.spell; -import com.minelittlepony.unicopia.UParticles; import com.minelittlepony.unicopia.entity.player.Pony; import com.minelittlepony.unicopia.magic.Affinity; import com.minelittlepony.unicopia.magic.Caster; import com.minelittlepony.unicopia.util.MagicalDamageSource; +import com.minelittlepony.unicopia.util.particles.UParticles; import com.minelittlepony.unicopia.util.shape.Sphere; import net.minecraft.entity.Entity; diff --git a/src/main/java/com/minelittlepony/unicopia/magic/spell/ChangelingTrapSpell.java b/src/main/java/com/minelittlepony/unicopia/magic/spell/ChangelingTrapSpell.java index 4f37418c..fb9d7081 100644 --- a/src/main/java/com/minelittlepony/unicopia/magic/spell/ChangelingTrapSpell.java +++ b/src/main/java/com/minelittlepony/unicopia/magic/spell/ChangelingTrapSpell.java @@ -2,11 +2,11 @@ package com.minelittlepony.unicopia.magic.spell; import java.util.Optional; -import com.minelittlepony.unicopia.UBlocks; -import com.minelittlepony.unicopia.UEntities; import com.minelittlepony.unicopia.USounds; +import com.minelittlepony.unicopia.block.UBlocks; import com.minelittlepony.unicopia.entity.CuccoonEntity; import com.minelittlepony.unicopia.entity.IMagicals; +import com.minelittlepony.unicopia.entity.UEntities; import com.minelittlepony.unicopia.magic.Affinity; import com.minelittlepony.unicopia.magic.CasterUtils; import com.minelittlepony.unicopia.magic.AttachedMagicEffect; diff --git a/src/main/java/com/minelittlepony/unicopia/magic/spell/DarknessSpell.java b/src/main/java/com/minelittlepony/unicopia/magic/spell/DarknessSpell.java index f93c0c61..579101e0 100644 --- a/src/main/java/com/minelittlepony/unicopia/magic/spell/DarknessSpell.java +++ b/src/main/java/com/minelittlepony/unicopia/magic/spell/DarknessSpell.java @@ -3,13 +3,13 @@ package com.minelittlepony.unicopia.magic.spell; import java.util.Random; import java.util.function.Consumer; -import com.minelittlepony.unicopia.UParticles; import com.minelittlepony.unicopia.entity.SpellcastEntity; import com.minelittlepony.unicopia.magic.Affinity; import com.minelittlepony.unicopia.magic.CasterUtils; import com.minelittlepony.unicopia.magic.Caster; import com.minelittlepony.unicopia.util.MagicalDamageSource; import com.minelittlepony.unicopia.util.PosHelper; +import com.minelittlepony.unicopia.util.particles.UParticles; import com.minelittlepony.unicopia.util.shape.Shape; import com.minelittlepony.unicopia.util.shape.Sphere; diff --git a/src/main/java/com/minelittlepony/unicopia/magic/spell/DisguiseSpell.java b/src/main/java/com/minelittlepony/unicopia/magic/spell/DisguiseSpell.java index 6bf1ccb2..0fabee01 100644 --- a/src/main/java/com/minelittlepony/unicopia/magic/spell/DisguiseSpell.java +++ b/src/main/java/com/minelittlepony/unicopia/magic/spell/DisguiseSpell.java @@ -7,7 +7,6 @@ import javax.annotation.Nullable; import com.minelittlepony.unicopia.InteractionManager; import com.minelittlepony.unicopia.Race; -import com.minelittlepony.unicopia.UParticles; import com.minelittlepony.unicopia.ability.FlightPredicate; import com.minelittlepony.unicopia.ability.HeightPredicate; import com.minelittlepony.unicopia.entity.Owned; @@ -18,6 +17,7 @@ import com.minelittlepony.unicopia.magic.AttachedMagicEffect; import com.minelittlepony.unicopia.magic.Caster; import com.minelittlepony.unicopia.magic.MagicEffect; import com.minelittlepony.unicopia.magic.SuppressableEffect; +import com.minelittlepony.unicopia.util.particles.UParticles; import com.minelittlepony.unicopia.util.projectile.ProjectileUtil; import com.mojang.authlib.GameProfile; diff --git a/src/main/java/com/minelittlepony/unicopia/magic/spell/IceSpell.java b/src/main/java/com/minelittlepony/unicopia/magic/spell/IceSpell.java index 89eb892c..d1ea9f0a 100644 --- a/src/main/java/com/minelittlepony/unicopia/magic/spell/IceSpell.java +++ b/src/main/java/com/minelittlepony/unicopia/magic/spell/IceSpell.java @@ -2,7 +2,7 @@ package com.minelittlepony.unicopia.magic.spell; import javax.annotation.Nullable; -import com.minelittlepony.unicopia.UMaterials; +import com.minelittlepony.unicopia.block.UMaterials; import com.minelittlepony.unicopia.magic.Affinity; import com.minelittlepony.unicopia.magic.CastResult; import com.minelittlepony.unicopia.magic.Caster; diff --git a/src/main/java/com/minelittlepony/unicopia/magic/spell/RevealingSpell.java b/src/main/java/com/minelittlepony/unicopia/magic/spell/RevealingSpell.java index ceab7fe0..6a59777d 100644 --- a/src/main/java/com/minelittlepony/unicopia/magic/spell/RevealingSpell.java +++ b/src/main/java/com/minelittlepony/unicopia/magic/spell/RevealingSpell.java @@ -1,9 +1,9 @@ package com.minelittlepony.unicopia.magic.spell; -import com.minelittlepony.unicopia.UParticles; import com.minelittlepony.unicopia.magic.Affinity; import com.minelittlepony.unicopia.magic.Caster; import com.minelittlepony.unicopia.magic.SuppressableEffect; +import com.minelittlepony.unicopia.util.particles.UParticles; import com.minelittlepony.unicopia.util.shape.Shape; import com.minelittlepony.unicopia.util.shape.Sphere; diff --git a/src/main/java/com/minelittlepony/unicopia/magic/spell/ScorchSpell.java b/src/main/java/com/minelittlepony/unicopia/magic/spell/ScorchSpell.java index 084bcf9c..d1c69851 100644 --- a/src/main/java/com/minelittlepony/unicopia/magic/spell/ScorchSpell.java +++ b/src/main/java/com/minelittlepony/unicopia/magic/spell/ScorchSpell.java @@ -2,11 +2,11 @@ package com.minelittlepony.unicopia.magic.spell; import javax.annotation.Nullable; -import com.minelittlepony.unicopia.UParticles; import com.minelittlepony.unicopia.magic.Affinity; import com.minelittlepony.unicopia.magic.Caster; import com.minelittlepony.unicopia.magic.TossedMagicEffect; import com.minelittlepony.unicopia.util.PosHelper; +import com.minelittlepony.unicopia.util.particles.UParticles; import com.minelittlepony.unicopia.util.projectile.AdvancedProjectile; import com.minelittlepony.unicopia.util.shape.Sphere; diff --git a/src/main/java/com/minelittlepony/unicopia/magic/spell/ShieldSpell.java b/src/main/java/com/minelittlepony/unicopia/magic/spell/ShieldSpell.java index be0358fd..2438cc2d 100644 --- a/src/main/java/com/minelittlepony/unicopia/magic/spell/ShieldSpell.java +++ b/src/main/java/com/minelittlepony/unicopia/magic/spell/ShieldSpell.java @@ -4,12 +4,12 @@ import java.util.List; import java.util.stream.Collectors; import com.minelittlepony.unicopia.EquinePredicates; -import com.minelittlepony.unicopia.UParticles; import com.minelittlepony.unicopia.entity.player.Pony; import com.minelittlepony.unicopia.magic.Affinity; import com.minelittlepony.unicopia.magic.AttachedMagicEffect; import com.minelittlepony.unicopia.magic.Caster; import com.minelittlepony.unicopia.util.particles.ParticleConnection; +import com.minelittlepony.unicopia.util.particles.UParticles; import com.minelittlepony.unicopia.util.projectile.ProjectileUtil; import com.minelittlepony.unicopia.util.shape.Sphere; diff --git a/src/main/java/com/minelittlepony/unicopia/toxin/ToxicBlockItem.java b/src/main/java/com/minelittlepony/unicopia/toxin/ToxicBlockItem.java index 87d4cf2d..2e347078 100644 --- a/src/main/java/com/minelittlepony/unicopia/toxin/ToxicBlockItem.java +++ b/src/main/java/com/minelittlepony/unicopia/toxin/ToxicBlockItem.java @@ -5,8 +5,8 @@ import java.util.List; import javax.annotation.Nullable; import com.minelittlepony.unicopia.Race; -import com.minelittlepony.unicopia.UEffects; import com.minelittlepony.unicopia.entity.player.Pony; +import com.minelittlepony.unicopia.item.UEffects; import net.minecraft.block.Block; import net.minecraft.client.item.TooltipContext; diff --git a/src/main/java/com/minelittlepony/unicopia/toxin/ToxicItem.java b/src/main/java/com/minelittlepony/unicopia/toxin/ToxicItem.java index b2ecd4a1..2e7a952e 100644 --- a/src/main/java/com/minelittlepony/unicopia/toxin/ToxicItem.java +++ b/src/main/java/com/minelittlepony/unicopia/toxin/ToxicItem.java @@ -5,8 +5,8 @@ import java.util.List; import javax.annotation.Nullable; import com.minelittlepony.unicopia.Race; -import com.minelittlepony.unicopia.UEffects; import com.minelittlepony.unicopia.entity.player.Pony; +import com.minelittlepony.unicopia.item.UEffects; import net.minecraft.client.item.TooltipContext; import net.minecraft.entity.LivingEntity; diff --git a/src/main/java/com/minelittlepony/util/BasicEasingInterpolator.java b/src/main/java/com/minelittlepony/unicopia/util/BasicEasingInterpolator.java similarity index 97% rename from src/main/java/com/minelittlepony/util/BasicEasingInterpolator.java rename to src/main/java/com/minelittlepony/unicopia/util/BasicEasingInterpolator.java index 23281dc8..6c21b440 100644 --- a/src/main/java/com/minelittlepony/util/BasicEasingInterpolator.java +++ b/src/main/java/com/minelittlepony/unicopia/util/BasicEasingInterpolator.java @@ -1,4 +1,4 @@ -package com.minelittlepony.util; +package com.minelittlepony.unicopia.util; import com.google.common.cache.CacheBuilder; import com.google.common.cache.CacheLoader; diff --git a/src/main/java/com/minelittlepony/unicopia/util/Color.java b/src/main/java/com/minelittlepony/unicopia/util/Color.java new file mode 100644 index 00000000..bbc5ea1e --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/util/Color.java @@ -0,0 +1,15 @@ +package com.minelittlepony.unicopia.util; + +public interface Color { + static float r(int hex) { + return (hex >> 16 & 255) / 255F; + } + + static float g(int hex) { + return (hex >> 8 & 255) / 255F; + } + + static float b(int hex) { + return (hex & 255) / 255F; + } +} diff --git a/src/main/java/com/minelittlepony/util/IInterpolator.java b/src/main/java/com/minelittlepony/unicopia/util/IInterpolator.java similarity index 92% rename from src/main/java/com/minelittlepony/util/IInterpolator.java rename to src/main/java/com/minelittlepony/unicopia/util/IInterpolator.java index 43d46a79..e38629f9 100644 --- a/src/main/java/com/minelittlepony/util/IInterpolator.java +++ b/src/main/java/com/minelittlepony/unicopia/util/IInterpolator.java @@ -1,4 +1,4 @@ -package com.minelittlepony.util; +package com.minelittlepony.unicopia.util; /** * Interpolator function for handling transitions between animation states. diff --git a/src/main/java/com/minelittlepony/util/MotionCompositor.java b/src/main/java/com/minelittlepony/unicopia/util/MotionCompositor.java similarity index 73% rename from src/main/java/com/minelittlepony/util/MotionCompositor.java rename to src/main/java/com/minelittlepony/unicopia/util/MotionCompositor.java index c7b855d7..1ac5b1bc 100644 --- a/src/main/java/com/minelittlepony/util/MotionCompositor.java +++ b/src/main/java/com/minelittlepony/unicopia/util/MotionCompositor.java @@ -1,4 +1,4 @@ -package com.minelittlepony.util; +package com.minelittlepony.unicopia.util; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.util.math.MathHelper; @@ -10,18 +10,30 @@ import net.minecraft.util.math.MathHelper; */ public abstract class MotionCompositor { + static double clampLimit(double num, double limit) { + return MathHelper.clamp(num, -limit, limit); + } + + static float sensibleAngle(float angle) { + angle %= 360; + + if (angle > 180) angle -= 360; + if (angle < -180) angle += 360; + + return angle; + } /** * Gets the angle of horizontal roll in degrees based on the player's vertical and horizontal motion. */ protected double calculateRoll(PlayerEntity player, double motionX, double motionY, double motionZ) { // since model roll should probably be calculated from model rotation rather than entity rotation... - double roll = MathUtil.sensibleAngle(player.field_6220 - player.field_6220); + double roll = sensibleAngle(player.field_6220 - player.field_6220); double horMotion = Math.sqrt(motionX * motionX + motionZ * motionZ); - float modelYaw = MathUtil.sensibleAngle(player.field_6220); + float modelYaw = sensibleAngle(player.field_6220); // detecting that we're flying backwards and roll must be inverted - if (Math.abs(MathUtil.sensibleAngle((float) Math.toDegrees(Math.atan2(motionX, motionZ)) + modelYaw)) > 90) { + if (Math.abs(sensibleAngle((float) Math.toDegrees(Math.atan2(motionX, motionZ)) + modelYaw)) > 90) { roll *= -1; } @@ -48,7 +60,7 @@ public abstract class MotionCompositor { angle /= 2; } - angle = MathUtil.clampLimit(angle, Math.PI / 3); + angle = clampLimit(angle, Math.PI / 3); return Math.toDegrees(angle); } diff --git a/src/main/java/com/minelittlepony/unicopia/util/PosHelper.java b/src/main/java/com/minelittlepony/unicopia/util/PosHelper.java index d67b2f68..3d096b57 100644 --- a/src/main/java/com/minelittlepony/unicopia/util/PosHelper.java +++ b/src/main/java/com/minelittlepony/unicopia/util/PosHelper.java @@ -14,13 +14,13 @@ import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3i; import net.minecraft.world.World; -public class PosHelper { +public interface PosHelper { - public static Vec3d offset(Vec3d a, Vec3i b) { + static Vec3d offset(Vec3d a, Vec3i b) { return a.add(b.getX(), b.getY(), b.getZ()); } - public static BlockPos findSolidGroundAt(World world, BlockPos pos) { + static BlockPos findSolidGroundAt(World world, BlockPos pos) { while ((pos.getY() > 0 || !World.isHeightInvalid(pos)) && (world.isAir(pos) || world.getBlockState(pos).canPlaceAt(world, pos))) { pos = pos.down(); @@ -29,13 +29,13 @@ public class PosHelper { return pos; } - public static void all(BlockPos origin, Consumer consumer, Direction... directions) { + static void all(BlockPos origin, Consumer consumer, Direction... directions) { for (Direction facing : directions) { consumer.accept(origin.offset(facing)); } } - public static boolean some(BlockPos origin, Predicate consumer, Direction... directions) { + static boolean some(BlockPos origin, Predicate consumer, Direction... directions) { for (Direction facing : directions) { if (consumer.test(origin.offset(facing))) { return true; @@ -44,7 +44,7 @@ public class PosHelper { return false; } - public static Iterators adjacentNeighbours(BlockPos origin) { + static Iterators adjacentNeighbours(BlockPos origin) { BlockPos.Mutable pos = new BlockPos.Mutable(origin); Iterator directions = Lists.newArrayList(Direction.values()).iterator(); @@ -60,7 +60,7 @@ public class PosHelper { }); } - public static Iterators getAllInRegionMutable(BlockPos origin, Shape shape) { + static Iterators getAllInRegionMutable(BlockPos origin, Shape shape) { Iterator iter = BlockPos.iterate( origin.add(new BlockPos(shape.getLowerBound())), origin.add(new BlockPos(shape.getUpperBound())) @@ -82,7 +82,8 @@ public class PosHelper { /** * Creates a stream of mutable block positions ranging from the beginning position to end. */ - public static Stream inRegion(BlockPos from, BlockPos to) { + @Deprecated + static Stream inRegion(BlockPos from, BlockPos to) { return BlockPos.stream(from, to); } } diff --git a/src/main/java/com/minelittlepony/unicopia/util/VecHelper.java b/src/main/java/com/minelittlepony/unicopia/util/VecHelper.java index a4eb0f13..00034c2f 100644 --- a/src/main/java/com/minelittlepony/unicopia/util/VecHelper.java +++ b/src/main/java/com/minelittlepony/unicopia/util/VecHelper.java @@ -20,8 +20,7 @@ import net.minecraft.util.math.Vec3d; import net.minecraft.world.RayTraceContext; import net.minecraft.world.World; -public class VecHelper { - +public interface VecHelper { /** * Performs a ray cast from the given entity and returns a result for the first block that ray intercepts. * @@ -33,7 +32,7 @@ public class VecHelper { * * @return RayTraceResult result or null */ - public static HitResult rayTrace(Entity e, double distance, float partialTick) { + static HitResult rayTrace(Entity e, double distance, float partialTick) { Vec3d cam = e.getCameraPosVec(partialTick); Vec3d look = e.getRotationVec(partialTick).multiply(distance); @@ -49,7 +48,7 @@ public class VecHelper { * Gets the entity the player is currently looking at, or null. */ @Nullable - public static Entity getLookedAtEntity(LivingEntity e, int reach) { + static Entity getLookedAtEntity(LivingEntity e, int reach) { HitResult objectMouseOver = getObjectMouseOver(e, reach, 1); if (objectMouseOver instanceof EntityHitResult && objectMouseOver.getType() == BlockHitResult.Type.ENTITY) { @@ -59,7 +58,7 @@ public class VecHelper { return null; } - public static Stream findAllEntitiesInRange(@Nullable Entity origin, World w, BlockPos pos, double radius) { + static Stream findAllEntitiesInRange(@Nullable Entity origin, World w, BlockPos pos, double radius) { BlockPos begin = pos.add(-radius, -radius, -radius); BlockPos end = pos.add(radius, radius, radius); @@ -77,7 +76,7 @@ public class VecHelper { /** * Gets all entities within a given range from the player. */ - public static List getWithinRange(PlayerEntity player, double reach, @Nullable Predicate predicate) { + static List getWithinRange(PlayerEntity player, double reach, @Nullable Predicate predicate) { Vec3d look = player.getCameraPosVec(1).multiply(reach); return player.world.getEntities(player, player @@ -95,7 +94,7 @@ public class VecHelper { * * @return RayTraceResult result or null */ - public static HitResult getObjectMouseOver(Entity e, double distance, float partialTick) { + static HitResult getObjectMouseOver(Entity e, double distance, float partialTick) { return getObjectMouseOver(e, distance, partialTick, EntityPredicates.EXCEPT_SPECTATOR); } @@ -111,7 +110,7 @@ public class VecHelper { * * @return RayTraceResult result or null */ - public static HitResult getObjectMouseOver(Entity e, double distance, float partialTick, Predicate predicate) { + static HitResult getObjectMouseOver(Entity e, double distance, float partialTick, Predicate predicate) { HitResult tracedBlock = rayTrace(e, distance, partialTick); double totalTraceDistance = distance; diff --git a/src/main/java/com/minelittlepony/unicopia/util/WorldHelper.java b/src/main/java/com/minelittlepony/unicopia/util/WorldHelper.java index 5524491b..ce67a833 100644 --- a/src/main/java/com/minelittlepony/unicopia/util/WorldHelper.java +++ b/src/main/java/com/minelittlepony/unicopia/util/WorldHelper.java @@ -2,16 +2,14 @@ package com.minelittlepony.unicopia.util; import net.minecraft.world.World; -public final class WorldHelper { - - +public interface WorldHelper { /** * Gets the daylight brightness value on a scale of 0-1. * Midday = 1 * Sunrise/Sunset = 0 * Nighttime = 0 */ - public static float getDaylightBrightness(World w, float partialTicks) { + static float getDaylightBrightness(World w, float partialTicks) { float celst = w.getSkyAngle(partialTicks); // ---------------------------- @@ -52,7 +50,7 @@ public final class WorldHelper { * Sunrise/Sunset = 0 * Daytime = 0 */ - public static float getLunarBrightness(World w, float partialTicks) { + static float getLunarBrightness(World w, float partialTicks) { float celst = w.getSkyAngle(partialTicks); // ---------------------------- diff --git a/src/main/java/com/minelittlepony/unicopia/util/collection/ListHelper.java b/src/main/java/com/minelittlepony/unicopia/util/collection/ListHelper.java deleted file mode 100644 index 4391ab11..00000000 --- a/src/main/java/com/minelittlepony/unicopia/util/collection/ListHelper.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.minelittlepony.unicopia.util.collection; - -import java.util.List; - -import net.minecraft.world.biome.Biome.SpawnEntry; - -public final class ListHelper { - public static void addifAbsent(List entries, SpawnEntry entry) { - if (!entries.contains(entry)) { - entries.add(entry); - } - } -} diff --git a/src/main/java/com/minelittlepony/unicopia/UParticles.java b/src/main/java/com/minelittlepony/unicopia/util/particles/UParticles.java similarity index 94% rename from src/main/java/com/minelittlepony/unicopia/UParticles.java rename to src/main/java/com/minelittlepony/unicopia/util/particles/UParticles.java index 56b7f226..30bb4568 100644 --- a/src/main/java/com/minelittlepony/unicopia/UParticles.java +++ b/src/main/java/com/minelittlepony/unicopia/util/particles/UParticles.java @@ -1,4 +1,4 @@ -package com.minelittlepony.unicopia; +package com.minelittlepony.unicopia.util.particles; import net.minecraft.particle.DefaultParticleType; import net.minecraft.util.Identifier; diff --git a/src/main/java/com/minelittlepony/util/Color.java b/src/main/java/com/minelittlepony/util/Color.java deleted file mode 100644 index 0891e0a7..00000000 --- a/src/main/java/com/minelittlepony/util/Color.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.minelittlepony.util; - -/** - * Colouration Utilities - */ -public interface Color { - - /** - * Returns the ALPHA channel for the given colour hex code. - */ - static float a(int hex) { - return (hex >> 24 & 255) / 255F; - } - - /** - * Returns the RED channel for the given colour hex code. - */ - static float r(int hex) { - return (hex >> 16 & 255) / 255F; - } - - /** - * Returns the GREEN channel for the given colour hex code. - */ - static float g(int hex) { - return (hex >> 8 & 255) / 255F; - } - - /** - * Returns the BLUE channel for the given colour hex code. - */ - static float b(int hex) { - return (hex & 255) / 255F; - } - - /** - * Converts the given rgb floats on a range of 0-1 into a colour hex code. - */ - static int argbToHex(float a, float r, float g, float b) { - return argbToHex((int)(a * 255), (int) (r * 255), (int) (g * 255), (int) (b * 255)); - } - - /** - * Converts the given rbg int on a range of 0-255 into a colour hex code. - */ - static int argbToHex(int a, int r, int g, int b) { - return (a << 24) | (r << 16) | (g << 8) | (b); - } - - /** - * Converts a colour hex code from BGR to RGB (and back). - */ - static int abgrToArgb(int color) { - return argbToHex(a(color), b(color), g(color), r(color)); - } -} diff --git a/src/main/java/com/minelittlepony/util/MathUtil.java b/src/main/java/com/minelittlepony/util/MathUtil.java deleted file mode 100644 index 28c5abf0..00000000 --- a/src/main/java/com/minelittlepony/util/MathUtil.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.minelittlepony.util; - -import net.minecraft.util.math.MathHelper; - -public class MathUtil { - - public static double clampLimit(double num, double limit) { - return MathHelper.clamp(num, -limit, limit); - } - - public static int mod(int value, int mod) { - value %= mod; - - while (value < 0) value += mod; - - return value; - } - - public static float sensibleAngle(float angle) { - angle %= 360; - - if (angle > 180) angle -= 360; - if (angle < -180) angle += 360; - - return angle; - } - - public static float interpolateDegress(float prev, float current, float partialTicks) { - float difference = current - prev; - - while (difference < -180) difference += 360; - while (difference >= 180) difference -= 360; - - return prev + partialTicks * difference; - } - - public static float interpolateRadians(float prev, float current, float partialTicks) { - return (float)Math.toRadians(interpolateDegress(prev, current, partialTicks)); - } - - public static boolean compareFloats(float a, float b) { - return Math.abs(a - b) <= 0.001F; - } -}