Browse Source

(Refactoring) Unified all number literals

- All float/double literals now have a decimal point and at least 1 digit in their
integral/fractional parts (e.g. 1. -> 1.0)
- All double literals no longer have a type suffix (e.g. 1.0D -> 1.0).
- All float literals have a capital F suffix (e.g. 1.0f -> 1.0F).
- All hex literals have a lowercase 0x and capitalized digits (e.g. 0X1a -> 0x1A).
master
Raptor 2 months ago
parent
commit
fa8dd6ebbb
51 changed files with 666 additions and 296 deletions
  1. +1
    -0
      .gitignore
  2. +3
    -3
      src/main/java/com/aether/CommonProxy.java
  3. +1
    -1
      src/main/java/com/aether/block/AercloudBlock.java
  4. +44
    -44
      src/main/java/com/aether/block/AetherBlocks.java
  5. +5
    -5
      src/main/java/com/aether/block/AetherPortalBlock.java
  6. +2
    -2
      src/main/java/com/aether/block/BerryBushStemBlock.java
  7. +1
    -1
      src/main/java/com/aether/block/BouncyAercloudBlock.java
  8. +2
    -2
      src/main/java/com/aether/block/ChestMimicBlock.java
  9. +4
    -4
      src/main/java/com/aether/block/EnchanterBlock.java
  10. +4
    -4
      src/main/java/com/aether/block/FreezerBlock.java
  11. +1
    -1
      src/main/java/com/aether/block/HealingAercloudBlock.java
  12. +1
    -1
      src/main/java/com/aether/block/IcestoneBlock.java
  13. +1
    -1
      src/main/java/com/aether/block/LeavesWithParticlesBlock.java
  14. +1
    -1
      src/main/java/com/aether/block/TrappedBlock.java
  15. +4
    -4
      src/main/java/com/aether/client/particle/AetherPortalParticle.java
  16. +3
    -3
      src/main/java/com/aether/client/particle/HolidayLeavesParticle.java
  17. +11
    -11
      src/main/java/com/aether/client/renderer/AetherSkyRenderer.java
  18. +1
    -1
      src/main/java/com/aether/client/renderer/entity/AerwhaleRenderer.java
  19. +1
    -1
      src/main/java/com/aether/client/renderer/entity/FloatingBlockRenderer.java
  20. +7
    -7
      src/main/java/com/aether/client/renderer/entity/LightningKnifeRenderer.java
  21. +1
    -1
      src/main/java/com/aether/client/renderer/entity/MimicRenderer.java
  22. +1
    -1
      src/main/java/com/aether/client/renderer/entity/MoaRenderer.java
  23. +4
    -4
      src/main/java/com/aether/client/renderer/entity/SentryRenderer.java
  24. +2
    -2
      src/main/java/com/aether/client/renderer/entity/ZephyrRenderer.java
  25. +4
    -4
      src/main/java/com/aether/client/renderer/entity/model/FlyingCowWingModel.java
  26. +29
    -29
      src/main/java/com/aether/client/renderer/entity/model/MimicModel.java
  27. +11
    -11
      src/main/java/com/aether/client/renderer/entity/model/MoaModel.java
  28. +8
    -8
      src/main/java/com/aether/client/renderer/entity/model/PhygWingModel.java
  29. +2
    -2
      src/main/java/com/aether/client/renderer/entity/model/ZephyrModel.java
  30. +1
    -1
      src/main/java/com/aether/entity/AetherEntityTypes.java
  31. +8
    -8
      src/main/java/com/aether/entity/item/FloatingBlockEntity.java
  32. +1
    -1
      src/main/java/com/aether/entity/monster/MimicEntity.java
  33. +7
    -7
      src/main/java/com/aether/entity/monster/SentryEntity.java
  34. +3
    -3
      src/main/java/com/aether/entity/monster/ZephyrEntity.java
  35. +13
    -13
      src/main/java/com/aether/entity/passive/FlyingCowEntity.java
  36. +1
    -1
      src/main/java/com/aether/entity/passive/MoaEntity.java
  37. +13
    -13
      src/main/java/com/aether/entity/passive/PhygEntity.java
  38. +13
    -13
      src/main/java/com/aether/entity/passive/SheepuffEntity.java
  39. +1
    -1
      src/main/java/com/aether/entity/projectile/ZephyrSnowballEntity.java
  40. +5
    -5
      src/main/java/com/aether/item/AetherArmorMaterial.java
  41. +5
    -5
      src/main/java/com/aether/item/AetherItemTier.java
  42. +31
    -31
      src/main/java/com/aether/item/AetherItems.java
  43. +1
    -1
      src/main/java/com/aether/item/IGravititeToolItem.java
  44. +7
    -7
      src/main/java/com/aether/item/IZaniteToolItem.java
  45. +2
    -2
      src/main/java/com/aether/item/LightningKnifeItem.java
  46. +3
    -3
      src/main/java/com/aether/item/PigSlayerItem.java
  47. +5
    -5
      src/main/java/com/aether/item/ZaniteSwordItem.java
  48. +9
    -9
      src/main/java/com/aether/world/AetherTeleporter.java
  49. +4
    -4
      src/main/java/com/aether/world/dimension/AetherDimension.java
  50. +4
    -4
      src/main/java/com/aether/world/gen/AetherChunkGenerator.java
  51. +369
    -0
      unify_number_literals.py

+ 1
- 0
.gitignore View File

@@ -20,6 +20,7 @@ build
# other
eclipse
run
__pycache__

# Files from Forge MDK
forge*changelog.txt

+ 3
- 3
src/main/java/com/aether/CommonProxy.java View File

@@ -138,9 +138,9 @@ public class CommonProxy {
double d1 = iposition.getY() + direction.getYOffset() * 0.3F;
double d2 = iposition.getZ() + direction.getZOffset() * 0.3F;
Random random = world.rand;
double d3 = random.nextGaussian() * 0.05D + direction.getXOffset();
double d4 = random.nextGaussian() * 0.05D + direction.getYOffset();
double d5 = random.nextGaussian() * 0.05D + direction.getZOffset();
double d3 = random.nextGaussian() * 0.05 + direction.getXOffset();
double d4 = random.nextGaussian() * 0.05 + direction.getYOffset();
double d5 = random.nextGaussian() * 0.05 + direction.getZOffset();
world.addEntity(Util.make(new SmallFireballEntity(world, d0, d1, d2, d3, d4, d5), (entity) -> entity.setStack(stack)));
stack.shrink(1);
}


+ 1
- 1
src/main/java/com/aether/block/AercloudBlock.java View File

@@ -24,7 +24,7 @@ public class AercloudBlock extends BreakableBlock {
@Override
public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity) {
entity.fallDistance = 0.0f;
entity.fallDistance = 0.0F;
if (entity.getMotion().y < 0) {
entity.setMotion(entity.getMotion().mul(1.0, 0.005, 1.0));


+ 44
- 44
src/main/java/com/aether/block/AetherBlocks.java View File

@@ -140,24 +140,24 @@ public class AetherBlocks {
block("aether_grass_block", new AetherGrassBlock(Block.Properties.from(Blocks.GRASS_BLOCK))),
block("enchanted_aether_grass_block", new EnchantedAetherGrassBlock(Block.Properties.from(Blocks.GRASS_BLOCK))),
block("aether_dirt", new DefaultAetherDoubleDropBlock(Block.Properties.from(Blocks.DIRT))),
block("holystone", new DefaultAetherDoubleDropBlock(Block.Properties.from(Blocks.STONE).hardnessAndResistance(0.5f))),
block("mossy_holystone", new DefaultAetherDoubleDropBlock(Block.Properties.from(Blocks.STONE).hardnessAndResistance(0.5f))),
block("holystone_bricks", new Block(Block.Properties.from(Blocks.STONE_BRICKS).hardnessAndResistance(0.5f, 10.0f))),
block("cold_aercloud", new AercloudBlock(Block.Properties.create(Material.ICE).hardnessAndResistance(0.2f).sound(SoundType.CLOTH).notSolid())),
block("blue_aercloud", new BouncyAercloudBlock(TintedAercloudBlock.COLOR_BLUE_OLD, TintedAercloudBlock.COLOR_BLUE_NEW, Block.Properties.create(Material.ICE).hardnessAndResistance(0.2f).sound(SoundType.CLOTH).notSolid())),
block("golden_aercloud", new TintedAercloudBlock(TintedAercloudBlock.COLOR_GOLDEN_OLD, TintedAercloudBlock.COLOR_GOLDEN_NEW, Block.Properties.create(Material.ICE).hardnessAndResistance(0.2f).sound(SoundType.CLOTH).notSolid())),
block("pink_aercloud", new HealingAercloudBlock(Block.Properties.create(Material.ICE).hardnessAndResistance(0.2f).sound(SoundType.CLOTH).notSolid())),
block("quicksoil", new DefaultAetherDoubleDropBlock(Block.Properties.from(Blocks.SAND).slipperiness(1.1f))),
block("icestone", new IcestoneBlock(Block.Properties.create(Material.ROCK).hardnessAndResistance(3.0f).tickRandomly().sound(SoundType.GLASS))),
block("ambrosium_ore", new AetherDoubleDropsOreBlock(0, 2, Block.Properties.create(Material.ROCK).hardnessAndResistance(3.0f).sound(SoundType.STONE).harvestTool(ToolType.PICKAXE).harvestLevel(0))),
block("zanite_ore", new AetherOreBlock(3, 5, Block.Properties.create(Material.ROCK).hardnessAndResistance(3.0f).sound(SoundType.STONE).harvestTool(ToolType.PICKAXE).harvestLevel(1))),
block("gravitite_ore", new FloatingBlock(false, Block.Properties.create(Material.ROCK).hardnessAndResistance(5.0f).sound(SoundType.STONE).harvestTool(ToolType.PICKAXE).harvestLevel(2))),
block("holystone", new DefaultAetherDoubleDropBlock(Block.Properties.from(Blocks.STONE).hardnessAndResistance(0.5F))),
block("mossy_holystone", new DefaultAetherDoubleDropBlock(Block.Properties.from(Blocks.STONE).hardnessAndResistance(0.5F))),
block("holystone_bricks", new Block(Block.Properties.from(Blocks.STONE_BRICKS).hardnessAndResistance(0.5F, 10.0F))),
block("cold_aercloud", new AercloudBlock(Block.Properties.create(Material.ICE).hardnessAndResistance(0.2F).sound(SoundType.CLOTH).notSolid())),
block("blue_aercloud", new BouncyAercloudBlock(TintedAercloudBlock.COLOR_BLUE_OLD, TintedAercloudBlock.COLOR_BLUE_NEW, Block.Properties.create(Material.ICE).hardnessAndResistance(0.2F).sound(SoundType.CLOTH).notSolid())),
block("golden_aercloud", new TintedAercloudBlock(TintedAercloudBlock.COLOR_GOLDEN_OLD, TintedAercloudBlock.COLOR_GOLDEN_NEW, Block.Properties.create(Material.ICE).hardnessAndResistance(0.2F).sound(SoundType.CLOTH).notSolid())),
block("pink_aercloud", new HealingAercloudBlock(Block.Properties.create(Material.ICE).hardnessAndResistance(0.2F).sound(SoundType.CLOTH).notSolid())),
block("quicksoil", new DefaultAetherDoubleDropBlock(Block.Properties.from(Blocks.SAND).slipperiness(1.1F))),
block("icestone", new IcestoneBlock(Block.Properties.create(Material.ROCK).hardnessAndResistance(3.0F).tickRandomly().sound(SoundType.GLASS))),
block("ambrosium_ore", new AetherDoubleDropsOreBlock(0, 2, Block.Properties.create(Material.ROCK).hardnessAndResistance(3.0F).sound(SoundType.STONE).harvestTool(ToolType.PICKAXE).harvestLevel(0))),
block("zanite_ore", new AetherOreBlock(3, 5, Block.Properties.create(Material.ROCK).hardnessAndResistance(3.0F).sound(SoundType.STONE).harvestTool(ToolType.PICKAXE).harvestLevel(1))),
block("gravitite_ore", new FloatingBlock(false, Block.Properties.create(Material.ROCK).hardnessAndResistance(5.0F).sound(SoundType.STONE).harvestTool(ToolType.PICKAXE).harvestLevel(2))),
block("skyroot_leaves", new LeavesBlock(Block.Properties.from(Blocks.OAK_LEAVES))),
block("golden_oak_leaves", new LeavesWithParticlesBlock(0.976f, 0.7450980392156863f, 0.0f, Block.Properties.from(Blocks.OAK_LEAVES))),
block("crystal_leaves", new LeavesWithParticlesBlock(0.0f, 0.6450980392156863f, 0.7450980392156863f, Block.Properties.from(Blocks.OAK_LEAVES))),
block("crystal_fruit_leaves", new LeavesWithParticlesBlock(0.0f, 0.6450980392156863f, 0.7450980392156863f, Block.Properties.from(Blocks.OAK_LEAVES))),
block("holiday_leaves", new LeavesWithParticlesBlock(1.0f, 1.0f, 1.0f, Block.Properties.from(Blocks.OAK_LEAVES))),
block("decorated_holiday_leaves", new LeavesWithParticlesBlock(1.0f, 1.0f, 1.0f, Block.Properties.from(Blocks.OAK_LEAVES))),
block("golden_oak_leaves", new LeavesWithParticlesBlock(0.976F, 0.7450980392156863F, 0.0F, Block.Properties.from(Blocks.OAK_LEAVES))),
block("crystal_leaves", new LeavesWithParticlesBlock(0.0F, 0.6450980392156863F, 0.7450980392156863F, Block.Properties.from(Blocks.OAK_LEAVES))),
block("crystal_fruit_leaves", new LeavesWithParticlesBlock(0.0F, 0.6450980392156863F, 0.7450980392156863F, Block.Properties.from(Blocks.OAK_LEAVES))),
block("holiday_leaves", new LeavesWithParticlesBlock(1.0F, 1.0F, 1.0F, Block.Properties.from(Blocks.OAK_LEAVES))),
block("decorated_holiday_leaves", new LeavesWithParticlesBlock(1.0F, 1.0F, 1.0F, Block.Properties.from(Blocks.OAK_LEAVES))),
block("skyroot_log", new AetherLogBlock(MaterialColor.WOOD, Block.Properties.from(Blocks.OAK_LOG))),
block("golden_oak_log", new AetherLogBlock(MaterialColor.WOOD, Block.Properties.from(Blocks.OAK_LOG))),
block("stripped_skyroot_log", new AetherLogBlock(MaterialColor.WOOD, Block.Properties.from(Blocks.STRIPPED_OAK_LOG))),
@@ -167,24 +167,24 @@ public class AetherBlocks {
block("stripped_skyroot_wood", new AetherDoubleDropsRotatedPillarBlock(Block.Properties.from(Blocks.STRIPPED_OAK_WOOD))),
block("stripped_golden_oak_wood", new AetherDoubleDropsRotatedPillarBlock(Block.Properties.from(Blocks.STRIPPED_OAK_WOOD))),
block("skyroot_planks", new Block(Block.Properties.from(Blocks.OAK_PLANKS))),
block("quicksoil_glass", new GlassBlock(Block.Properties.from(Blocks.GLASS).slipperiness(1.1f).lightValue(11))),
block("aerogel", new AerogelBlock(Block.Properties.create(Material.ROCK).hardnessAndResistance(1.0f, 2000.0f).sound(SoundType.METAL).notSolid())),
block("quicksoil_glass", new GlassBlock(Block.Properties.from(Blocks.GLASS).slipperiness(1.1F).lightValue(11))),
block("aerogel", new AerogelBlock(Block.Properties.create(Material.ROCK).hardnessAndResistance(1.0F, 2000.0F).sound(SoundType.METAL).notSolid())),
block("zanite_block", new Block(Block.Properties.from(Blocks.IRON_BLOCK))),
block("enchanted_gravitite", new FloatingBlock(true, Block.Properties.from(Blocks.IRON_BLOCK))),
block("berry_bush", new BerryBushBlock(Block.Properties.create(Material.PLANTS).hardnessAndResistance(0.2f).sound(SoundType.PLANT))),
block("berry_bush_stem", new BerryBushStemBlock(Block.Properties.create(Material.PLANTS).hardnessAndResistance(0.2f).sound(SoundType.PLANT))),
block("enchanter", new EnchanterBlock(Block.Properties.create(Material.ROCK).hardnessAndResistance(2.0f).sound(SoundType.STONE))),
block("freezer", new FreezerBlock(Block.Properties.create(Material.ROCK).hardnessAndResistance(2.0f).sound(SoundType.STONE))),
block("incubator", new IncubatorBlock(Block.Properties.create(Material.ROCK).hardnessAndResistance(2.0f).sound(SoundType.STONE))),
block("berry_bush", new BerryBushBlock(Block.Properties.create(Material.PLANTS).hardnessAndResistance(0.2F).sound(SoundType.PLANT))),
block("berry_bush_stem", new BerryBushStemBlock(Block.Properties.create(Material.PLANTS).hardnessAndResistance(0.2F).sound(SoundType.PLANT))),
block("enchanter", new EnchanterBlock(Block.Properties.create(Material.ROCK).hardnessAndResistance(2.0F).sound(SoundType.STONE))),
block("freezer", new FreezerBlock(Block.Properties.create(Material.ROCK).hardnessAndResistance(2.0F).sound(SoundType.STONE))),
block("incubator", new IncubatorBlock(Block.Properties.create(Material.ROCK).hardnessAndResistance(2.0F).sound(SoundType.STONE))),
block("ambrosium_torch", new TorchBlock(Block.Properties.from(Blocks.TORCH))),
block("chest_mimic", new ChestMimicBlock(Block.Properties.from(Blocks.CHEST))),
//block("treasure_chest", new TreasureChestBlock(???)),
block("carved_stone", new Block(Block.Properties.create(Material.ROCK).hardnessAndResistance(0.5f).sound(SoundType.STONE))),
block("sentry_stone", new Block(Block.Properties.create(Material.ROCK).hardnessAndResistance(0.5f).lightValue(11).sound(SoundType.STONE))),
block("angelic_stone", new Block(Block.Properties.create(Material.ROCK).hardnessAndResistance(0.5f).sound(SoundType.STONE))),
block("light_angelic_stone", new Block(Block.Properties.create(Material.ROCK).hardnessAndResistance(0.5f).lightValue(11).sound(SoundType.STONE))),
block("hellfire_stone", new Block(Block.Properties.create(Material.ROCK).hardnessAndResistance(0.5f).sound(SoundType.STONE))),
block("light_hellfire_stone", new Block(Block.Properties.create(Material.ROCK).hardnessAndResistance(0.5f).lightValue(11).sound(SoundType.STONE))),
block("carved_stone", new Block(Block.Properties.create(Material.ROCK).hardnessAndResistance(0.5F).sound(SoundType.STONE))),
block("sentry_stone", new Block(Block.Properties.create(Material.ROCK).hardnessAndResistance(0.5F).lightValue(11).sound(SoundType.STONE))),
block("angelic_stone", new Block(Block.Properties.create(Material.ROCK).hardnessAndResistance(0.5F).sound(SoundType.STONE))),
block("light_angelic_stone", new Block(Block.Properties.create(Material.ROCK).hardnessAndResistance(0.5F).lightValue(11).sound(SoundType.STONE))),
block("hellfire_stone", new Block(Block.Properties.create(Material.ROCK).hardnessAndResistance(0.5F).sound(SoundType.STONE))),
block("light_hellfire_stone", new Block(Block.Properties.create(Material.ROCK).hardnessAndResistance(0.5F).lightValue(11).sound(SoundType.STONE))),
block("locked_carved_stone", new Block(Block.Properties.from(Blocks.BEDROCK))),
block("locked_sentry_stone", new Block(Block.Properties.from(Blocks.BEDROCK).lightValue(11))),
block("locked_angelic_stone", new Block(Block.Properties.from(Blocks.BEDROCK))),
@@ -205,14 +205,14 @@ public class AetherBlocks {
block("pillar_top", new RotatedPillarBlock(Block.Properties.from(Blocks.QUARTZ_PILLAR).hardnessAndResistance(0.5F).sound(SoundType.METAL))),
block("skyroot_fence", new FenceBlock(Block.Properties.from(Blocks.OAK_FENCE))),
block("skyroot_fence_gate", new FenceGateBlock(Block.Properties.from(Blocks.OAK_FENCE_GATE))),
block("carved_stairs", new StairsBlock(() -> AetherBlocks.CARVED_STONE.getDefaultState(), Block.Properties.create(Material.ROCK).hardnessAndResistance(0.5f).sound(SoundType.STONE))),
block("angelic_stairs", new StairsBlock(() -> AetherBlocks.ANGELIC_STONE.getDefaultState(), Block.Properties.create(Material.ROCK).hardnessAndResistance(0.5f).sound(SoundType.STONE))),
block("hellfire_stairs", new StairsBlock(() -> AetherBlocks.HELLFIRE_STONE.getDefaultState(), Block.Properties.create(Material.ROCK).hardnessAndResistance(0.5f).sound(SoundType.STONE))),
block("carved_stairs", new StairsBlock(() -> AetherBlocks.CARVED_STONE.getDefaultState(), Block.Properties.create(Material.ROCK).hardnessAndResistance(0.5F).sound(SoundType.STONE))),
block("angelic_stairs", new StairsBlock(() -> AetherBlocks.ANGELIC_STONE.getDefaultState(), Block.Properties.create(Material.ROCK).hardnessAndResistance(0.5F).sound(SoundType.STONE))),
block("hellfire_stairs", new StairsBlock(() -> AetherBlocks.HELLFIRE_STONE.getDefaultState(), Block.Properties.create(Material.ROCK).hardnessAndResistance(0.5F).sound(SoundType.STONE))),
block("skyroot_stairs", new StairsBlock(() -> AetherBlocks.SKYROOT_PLANKS.getDefaultState(), Block.Properties.from(Blocks.OAK_PLANKS))),
block("holystone_stairs", new StairsBlock(() -> AetherBlocks.HOLYSTONE.getDefaultState(), Block.Properties.from(Blocks.STONE).hardnessAndResistance(0.5f))),
block("mossy_holystone_stairs", new StairsBlock(() -> AetherBlocks.MOSSY_HOLYSTONE.getDefaultState(), Block.Properties.from(Blocks.STONE).hardnessAndResistance(0.5f))),
block("holystone_brick_stairs", new StairsBlock(() -> AetherBlocks.HOLYSTONE_BRICKS.getDefaultState(), Block.Properties.from(Blocks.STONE_BRICKS).hardnessAndResistance(0.5f, 10.0f))),
block("aerogel_stairs", new AerogelStairsBlock(() -> AetherBlocks.AEROGEL.getDefaultState(), Block.Properties.create(Material.ROCK).hardnessAndResistance(1.0f, 2000.0f).sound(SoundType.METAL).notSolid())),
block("holystone_stairs", new StairsBlock(() -> AetherBlocks.HOLYSTONE.getDefaultState(), Block.Properties.from(Blocks.STONE).hardnessAndResistance(0.5F))),
block("mossy_holystone_stairs", new StairsBlock(() -> AetherBlocks.MOSSY_HOLYSTONE.getDefaultState(), Block.Properties.from(Blocks.STONE).hardnessAndResistance(0.5F))),
block("holystone_brick_stairs", new StairsBlock(() -> AetherBlocks.HOLYSTONE_BRICKS.getDefaultState(), Block.Properties.from(Blocks.STONE_BRICKS).hardnessAndResistance(0.5F, 10.0F))),
block("aerogel_stairs", new AerogelStairsBlock(() -> AetherBlocks.AEROGEL.getDefaultState(), Block.Properties.create(Material.ROCK).hardnessAndResistance(1.0F, 2000.0F).sound(SoundType.METAL).notSolid())),
block("carved_slab", new SlabBlock(Block.Properties.create(Material.ROCK, MaterialColor.STONE).hardnessAndResistance(2.0F, 5.0F))),
block("angelic_slab", new SlabBlock(Block.Properties.create(Material.ROCK, MaterialColor.STONE).hardnessAndResistance(2.0F, 5.0F))),
block("hellfire_slab", new SlabBlock(Block.Properties.create(Material.ROCK, MaterialColor.STONE).hardnessAndResistance(2.0F, 5.0F))),
@@ -221,13 +221,13 @@ public class AetherBlocks {
block("mossy_holystone_slab", new SlabBlock(Block.Properties.create(Material.ROCK, MaterialColor.STONE).hardnessAndResistance(2.0F, 5.0F))),
block("holystone_brick_slab", new SlabBlock(Block.Properties.create(Material.ROCK, MaterialColor.STONE).hardnessAndResistance(2.0F, 5.0F))),
block("aerogel_slab", new AerogelSlabBlock(Block.Properties.create(Material.ROCK).hardnessAndResistance(1.0F, 2000.0F).sound(SoundType.METAL).notSolid())),
block("carved_wall", new WallBlock(Block.Properties.create(Material.ROCK).hardnessAndResistance(0.5f).sound(SoundType.STONE))),
block("angelic_wall", new WallBlock(Block.Properties.create(Material.ROCK).hardnessAndResistance(0.5f).sound(SoundType.STONE))),
block("hellfire_wall", new WallBlock(Block.Properties.create(Material.ROCK).hardnessAndResistance(0.5f).sound(SoundType.STONE))),
block("holystone_wall", new WallBlock(Block.Properties.from(Blocks.STONE).hardnessAndResistance(0.5f))),
block("mossy_holystone_wall", new WallBlock(Block.Properties.from(Blocks.STONE).hardnessAndResistance(0.5f))),
block("holystone_brick_wall", new WallBlock(Block.Properties.from(Blocks.STONE).hardnessAndResistance(0.5f))),
block("aerogel_wall", new AerogelWallBlock(Block.Properties.from(Blocks.STONE).hardnessAndResistance(0.5f, 2000.0F).notSolid())),
block("carved_wall", new WallBlock(Block.Properties.create(Material.ROCK).hardnessAndResistance(0.5F).sound(SoundType.STONE))),
block("angelic_wall", new WallBlock(Block.Properties.create(Material.ROCK).hardnessAndResistance(0.5F).sound(SoundType.STONE))),
block("hellfire_wall", new WallBlock(Block.Properties.create(Material.ROCK).hardnessAndResistance(0.5F).sound(SoundType.STONE))),
block("holystone_wall", new WallBlock(Block.Properties.from(Blocks.STONE).hardnessAndResistance(0.5F))),
block("mossy_holystone_wall", new WallBlock(Block.Properties.from(Blocks.STONE).hardnessAndResistance(0.5F))),
block("holystone_brick_wall", new WallBlock(Block.Properties.from(Blocks.STONE).hardnessAndResistance(0.5F))),
block("aerogel_wall", new AerogelWallBlock(Block.Properties.from(Blocks.STONE).hardnessAndResistance(0.5F, 2000.0F).notSolid())),
block("present", new PresentBlock(Block.Properties.create(Material.ORGANIC).hardnessAndResistance(0.6F).sound(SoundType.PLANT))),
block("sun_altar", new SunAltarBlock(Block.Properties.create(Material.ROCK).hardnessAndResistance(2.5F).sound(SoundType.METAL))),
block("skyroot_bookshelf", new BookshelfBlock(Block.Properties.from(Blocks.BOOKSHELF))),


+ 5
- 5
src/main/java/com/aether/block/AetherPortalBlock.java View File

@@ -47,8 +47,8 @@ import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
@EventBusSubscriber(modid = Aether.MODID)
public class AetherPortalBlock extends Block {
public static final EnumProperty<Axis> AXIS = BlockStateProperties.HORIZONTAL_AXIS;
protected static final VoxelShape X_AABB = Block.makeCuboidShape(0.0D, 0.0D, 6.0D, 16.0D, 16.0D, 10.0D);
protected static final VoxelShape Z_AABB = Block.makeCuboidShape(6.0D, 0.0D, 0.0D, 10.0D, 16.0D, 16.0D);
protected static final VoxelShape X_AABB = Block.makeCuboidShape(0.0, 0.0, 6.0, 16.0, 16.0, 10.0);
protected static final VoxelShape Z_AABB = Block.makeCuboidShape(6.0, 0.0, 0.0, 10.0, 16.0, 16.0);

public AetherPortalBlock(Block.Properties properties) {
super(properties);
@@ -132,7 +132,7 @@ public class AetherPortalBlock extends Block {
@OnlyIn(Dist.CLIENT)
public void animateTick(BlockState stateIn, World worldIn, BlockPos pos, Random rand) {
if (rand.nextInt(100) == 0) {
worldIn.playSound(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, AetherSoundEvents.BLOCK_AETHER_PORTAL_AMBIENT, SoundCategory.BLOCKS, 0.5f, rand.nextFloat() * 0.4f + 0.8f, false);
worldIn.playSound(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, AetherSoundEvents.BLOCK_AETHER_PORTAL_AMBIENT, SoundCategory.BLOCKS, 0.5F, rand.nextFloat() * 0.4F + 0.8F, false);
}

for (int i = 0; i < 4; ++i) {
@@ -146,11 +146,11 @@ public class AetherPortalBlock extends Block {

if (worldIn.getBlockState(pos.west()).getBlock() != this && worldIn.getBlockState(pos.east()).getBlock() != this) {
x = pos.getX() + 0.5 + 0.25 * mul;
sX = rand.nextFloat() * 2.0f * mul;
sX = rand.nextFloat() * 2.0F * mul;
}
else {
z = pos.getZ() + 0.5 + 0.25 * mul;
sZ = rand.nextFloat() * 2.0f * mul;
sZ = rand.nextFloat() * 2.0F * mul;
}

worldIn.addParticle(AetherParticleTypes.AETHER_PORTAL, x, y, z, sX, sY, sZ);


+ 2
- 2
src/main/java/com/aether/block/BerryBushStemBlock.java View File

@@ -13,7 +13,7 @@ import net.minecraft.world.World;
import net.minecraft.world.server.ServerWorld;

public class BerryBushStemBlock extends AetherBushBlock implements IGrowable {
protected static final VoxelShape SHAPE = Block.makeCuboidShape(2.0D, 0.0D, 2.0D, 14.0D, 13.0D, 14.0D);
protected static final VoxelShape SHAPE = Block.makeCuboidShape(2.0, 0.0, 2.0, 14.0, 13.0, 14.0);

public BerryBushStemBlock(Block.Properties properties) {
super(properties);
@@ -42,7 +42,7 @@ public class BerryBushStemBlock extends AetherBushBlock implements IGrowable {

@Override
public boolean canUseBonemeal(World worldIn, Random rand, BlockPos pos, BlockState state) {
return rand.nextFloat() < 0.45f;
return rand.nextFloat() < 0.45F;
}

@Override


+ 1
- 1
src/main/java/com/aether/block/BouncyAercloudBlock.java View File

@@ -19,7 +19,7 @@ public class BouncyAercloudBlock extends TintedAercloudBlock {
@Override
public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity) {
entity.fallDistance = 0.0f;
entity.fallDistance = 0.0F;
Vec3d motion = entity.getMotion();


+ 2
- 2
src/main/java/com/aether/block/ChestMimicBlock.java View File

@@ -91,14 +91,14 @@ public class ChestMimicBlock extends Block implements IWaterLoggable {
float angle = facing.getHorizontalAngle();

MimicEntity mimic = new MimicEntity(worldIn);
mimic.setPositionAndRotation(pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5, angle, 0.0f);
mimic.setPositionAndRotation(pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5, angle, 0.0F);
// mimic.rotationYaw = angle;
mimic.setRotationYawHead(angle);
// mimic.setHeadRotation(angle, 0);
LogManager.getLogger(ChestMimicBlock.class).debug("mimic rotation {} {}", facing, angle);
worldIn.addEntity(mimic);
worldIn.setBlockState(pos, Blocks.AIR.getDefaultState());
worldIn.playSound(null, pos, SoundEvents.BLOCK_CHEST_OPEN, SoundCategory.BLOCKS, 0.5f, worldIn.rand.nextFloat() * 0.1f + 0.9f);
worldIn.playSound(null, pos, SoundEvents.BLOCK_CHEST_OPEN, SoundCategory.BLOCKS, 0.5F, worldIn.rand.nextFloat() * 0.1F + 0.9F);

return ActionResultType.SUCCESS;
}


+ 4
- 4
src/main/java/com/aether/block/EnchanterBlock.java View File

@@ -41,15 +41,15 @@ public class EnchanterBlock extends AbstractAetherFurnaceBlock {
@Override
public void animateTick(BlockState state, World world, BlockPos pos, Random rand) {
if (state.get(LIT)) {
float x = pos.getX() + 0.5f;
float y = pos.getY() + 1.0f + (rand.nextFloat() * 6.0f) / 16.0f;
float z = pos.getZ() + 0.5f;
float x = pos.getX() + 0.5F;
float y = pos.getY() + 1.0F + (rand.nextFloat() * 6.0F) / 16.0F;
float z = pos.getZ() + 0.5F;
world.addParticle(ParticleTypes.SMOKE, x, y, z, 0.0, 0.0, 0.0);
world.addParticle(ParticleTypes.FLAME, x, y, z, 0.0, 0.0, 0.0);
if (rand.nextDouble() < 0.1) {
world.playSound(pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5, SoundEvents.BLOCK_FURNACE_FIRE_CRACKLE, SoundCategory.BLOCKS, 1.0f, 1.0f, false);
world.playSound(pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5, SoundEvents.BLOCK_FURNACE_FIRE_CRACKLE, SoundCategory.BLOCKS, 1.0F, 1.0F, false);
}
}
}


+ 4
- 4
src/main/java/com/aether/block/FreezerBlock.java View File

@@ -41,15 +41,15 @@ public class FreezerBlock extends AbstractAetherFurnaceBlock {
@Override
public void animateTick(BlockState state, World world, BlockPos pos, Random rand) {
if (state.get(LIT)) {
float x = pos.getX() + 0.5f;
float y = pos.getY() + 1.0f + (rand.nextFloat() * 6.0f) / 16.0f;
float z = pos.getZ() + 0.5f;
float x = pos.getX() + 0.5F;
float y = pos.getY() + 1.0F + (rand.nextFloat() * 6.0F) / 16.0F;
float z = pos.getZ() + 0.5F;
world.addParticle(ParticleTypes.SMOKE, x, y, z, 0.0, 0.0, 0.0);
world.addParticle(ParticleTypes.FLAME, x, y, z, 0.0, 0.0, 0.0);
if (rand.nextDouble() < 0.1) {
world.playSound(pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5, SoundEvents.BLOCK_FURNACE_FIRE_CRACKLE, SoundCategory.BLOCKS, 1.0f, 1.0f, false);
world.playSound(pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5, SoundEvents.BLOCK_FURNACE_FIRE_CRACKLE, SoundCategory.BLOCKS, 1.0F, 1.0F, false);
}
}
}


+ 1
- 1
src/main/java/com/aether/block/HealingAercloudBlock.java View File

@@ -18,7 +18,7 @@ public class HealingAercloudBlock extends AercloudBlock {
super.onEntityCollision(state, world, pos, entity);
if (entity.ticksExisted % 20 == 0 && entity instanceof LivingEntity) {
((LivingEntity) entity).heal(1.0f);
((LivingEntity) entity).heal(1.0F);
}
}


+ 1
- 1
src/main/java/com/aether/block/IcestoneBlock.java View File

@@ -38,7 +38,7 @@ public class IcestoneBlock extends Block {
}
else if (fluidState.isTagged(FluidTags.LAVA)) {
worldIn.setBlockState(newPos, Blocks.OBSIDIAN.getDefaultState());
worldIn.playSound(null, newPos, SoundEvents.BLOCK_LAVA_EXTINGUISH, SoundCategory.BLOCKS, 1.0f, 1.0f);
worldIn.playSound(null, newPos, SoundEvents.BLOCK_LAVA_EXTINGUISH, SoundCategory.BLOCKS, 1.0F, 1.0F);
}
}
}


+ 1
- 1
src/main/java/com/aether/block/LeavesWithParticlesBlock.java View File

@@ -18,7 +18,7 @@ public class LeavesWithParticlesBlock extends LeavesBlock {
private final IParticleData particle;
public LeavesWithParticlesBlock(float particleRed, float particleGreen, float particleBlue, Block.Properties properties) {
this(particleRed, particleGreen, particleBlue, 1.0f, properties);
this(particleRed, particleGreen, particleBlue, 1.0F, properties);
}
public LeavesWithParticlesBlock(float particleRed, float particleGreen, float particleBlue, float particleAlpha, Block.Properties properties) {


+ 1
- 1
src/main/java/com/aether/block/TrappedBlock.java View File

@@ -35,7 +35,7 @@ public class TrappedBlock extends Block {
if (!world.isRemote) {
EntityType<?> entityType = entityTypeSupplier.get();
Entity entity = entityType.create(world);
entity.setPositionAndRotation(pos.getX() + 0.5, pos.getY() + 1, pos.getZ() + 0.5, rand.nextFloat() * 360.0f, 0.0f);
entity.setPositionAndRotation(pos.getX() + 0.5, pos.getY() + 1, pos.getZ() + 0.5, rand.nextFloat() * 360.0F, 0.0F);
world.addEntity(entity);
}


+ 4
- 4
src/main/java/com/aether/client/particle/AetherPortalParticle.java View File

@@ -15,11 +15,11 @@ public class AetherPortalParticle extends PortalParticle {
protected AetherPortalParticle(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn) {
super(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
float f = this.rand.nextFloat() * 0.6f + 0.4f;
float f = this.rand.nextFloat() * 0.6F + 0.4F;
this.particleRed = this.particleGreen = this.particleBlue = 1.0f * f;
this.particleRed *= 0.2f;
this.particleGreen *= 0.2f;
this.particleRed = this.particleGreen = this.particleBlue = 1.0F * f;
this.particleRed *= 0.2F;
this.particleGreen *= 0.2F;
}
@OnlyIn(Dist.CLIENT)


+ 3
- 3
src/main/java/com/aether/client/particle/HolidayLeavesParticle.java View File

@@ -15,9 +15,9 @@ public class HolidayLeavesParticle extends PortalParticle {
protected HolidayLeavesParticle(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn) {
super(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);

this.particleRed = 1.0f;
this.particleGreen = 1.0f;
this.particleBlue = 1.0f;
this.particleRed = 1.0F;
this.particleGreen = 1.0F;
this.particleBlue = 1.0F;
}

@OnlyIn(Dist.CLIENT)


+ 11
- 11
src/main/java/com/aether/client/renderer/AetherSkyRenderer.java View File

@@ -91,33 +91,33 @@ public class AetherSkyRenderer implements SkyRenderHandler {
double d2 = random.nextFloat() * 2.0F - 1.0F;
double d3 = 0.15F + random.nextFloat() * 0.1F;
double d4 = d0 * d0 + d1 * d1 + d2 * d2;
if (d4 < 1.0D && d4 > 0.01D) {
d4 = 1.0D / Math.sqrt(d4);
if (d4 < 1.0 && d4 > 0.01) {
d4 = 1.0 / Math.sqrt(d4);
d0 = d0 * d4;
d1 = d1 * d4;
d2 = d2 * d4;
double d5 = d0 * 100.0D;
double d6 = d1 * 100.0D;
double d7 = d2 * 100.0D;
double d5 = d0 * 100.0;
double d6 = d1 * 100.0;
double d7 = d2 * 100.0;
double d8 = Math.atan2(d0, d2);
double d9 = Math.sin(d8);
double d10 = Math.cos(d8);
double d11 = Math.atan2(Math.sqrt(d0 * d0 + d2 * d2), d1);
double d12 = Math.sin(d11);
double d13 = Math.cos(d11);
double d14 = random.nextDouble() * Math.PI * 2.0D;
double d14 = random.nextDouble() * Math.PI * 2.0;
double d15 = Math.sin(d14);
double d16 = Math.cos(d14);

for (int j = 0; j < 4; ++j) {
double d17 = 0.0D;
double d17 = 0.0;
double d18 = ((j & 2) - 1) * d3;
double d19 = ((j + 1 & 2) - 1) * d3;
double d20 = 0.0D;
double d20 = 0.0;
double d21 = d18 * d16 - d19 * d15;
double d22 = d19 * d16 + d18 * d15;
double d23 = d21 * d12 + 0.0D * d13;
double d24 = 0.0D * d12 - d21 * d13;
double d23 = d21 * d12 + 0.0 * d13;
double d24 = 0.0 * d12 - d21 * d13;
double d25 = d24 * d9 - d22 * d10;
double d26 = d22 * d9 + d24 * d10;
bufferBuilderIn.pos(d5 + d25, d6 + d23, d7 + d26).endVertex();
@@ -192,7 +192,7 @@ public class AetherSkyRenderer implements SkyRenderHandler {
int i = 16;

for (int j = 0; j <= 16; ++j) {
float f7 = j * ((float)Math.PI * 2F) / 16.0F;
float f7 = j * ((float)Math.PI * 2.0F) / 16.0F;
float f8 = MathHelper.sin(f7);
float f9 = MathHelper.cos(f7);
bufferbuilder.pos(matrix4f, f8 * 120.0F, f9 * 120.0F, -f9 * 40.0F * afloat[3])


+ 1
- 1
src/main/java/com/aether/client/renderer/entity/AerwhaleRenderer.java View File

@@ -18,7 +18,7 @@ public class AerwhaleRenderer extends MobRenderer<AerwhaleEntity, AerwhaleModel>

@Override
protected void preRenderCallback(AerwhaleEntity aerwhale, MatrixStack matrixStackIn, float partialTickTime) {
matrixStackIn.translate(0, 1.2D, 0);
matrixStackIn.translate(0, 1.2, 0);
matrixStackIn.rotate(new Quaternion(-90.0F, 0.0F, 1.0F, 0.0F));
matrixStackIn.scale(2.0F, 2.0F, 2.0F);



+ 1
- 1
src/main/java/com/aether/client/renderer/entity/FloatingBlockRenderer.java View File

@@ -26,7 +26,7 @@ public class FloatingBlockRenderer extends EntityRenderer<FloatingBlockEntity> {

public FloatingBlockRenderer(EntityRendererManager renderManager) {
super(renderManager);
this.shadowSize = 0.5f;
this.shadowSize = 0.5F;
}

@SuppressWarnings("deprecation")


+ 7
- 7
src/main/java/com/aether/client/renderer/entity/LightningKnifeRenderer.java View File

@@ -26,7 +26,7 @@ public class LightningKnifeRenderer extends EntityRenderer<LightningKnifeEntity>
@Override
public void render(LightningKnifeEntity entityIn, float entityYaw, float partialTicks, MatrixStack matrix, IRenderTypeBuffer bufferIn, int packedLightIn) {
matrix.push();
//matrixStackIn.scale(1.0f, 1.0f, 1.0f);
//matrixStackIn.scale(1.0F, 1.0F, 1.0F);
Quaternion base;
@@ -38,17 +38,17 @@ public class LightningKnifeRenderer extends EntityRenderer<LightningKnifeEntity>
// matrix.rotate(Vector3f.YP.rotationDegrees(entityIn.rotationYaw));
// matrix.rotate(Vector3f.XP.rotationDegrees(-(entityIn.prevRotationPitch + (entityIn.rotationPitch - entityIn.prevRotationPitch) * partialTicks)));
// matrix.rotate(Vector3f.YP.rotationDegrees(45.0f));
// matrix.rotate(Vector3f.YP.rotationDegrees(45.0F));

// Quaternion base;
//
// base = Vector3f.YP.rotationDegrees(entityYaw);
// float entityYawRadians = entityYaw * (float)(Math.PI / 180f);
// float entityYawRadians = entityYaw * (float)(Math.PI / 180.0F);
// Vector3f temp = Vector3f.ZP.copy();
// temp.transform(base);
// base.multiply(temp.rotationDegrees(45.0f));
// base.multiply(temp.rotationDegrees(45.0F));
//
// Quaternion temp = Vector3f.XP.rotationDegrees(90.0f);
// Quaternion temp = Vector3f.XP.rotationDegrees(90.0F);
// temp.conjugate();
// base.multiply(temp);
// base.conjugate();
@@ -59,8 +59,8 @@ public class LightningKnifeRenderer extends EntityRenderer<LightningKnifeEntity>
// matrix.rotate(Vector3f.XP.rotationDegrees(90.0f));
// matrix.rotate(Vector3f.ZP.rotationDegrees(45.0f));
// matrix.rotate(Vector3f.XP.rotationDegrees(90.0F));
// matrix.rotate(Vector3f.ZP.rotationDegrees(45.0F));
// matrix.rotate(Vector3f.YP.rotationDegrees(entityYaw));
Minecraft.getInstance().getItemRenderer().renderItem(Objects.requireNonNull(((IRendersAsItem)entityIn).getItem()), ItemCameraTransforms.TransformType.GUI, packedLightIn, OverlayTexture.NO_OVERLAY, matrix, bufferIn);


+ 1
- 1
src/main/java/com/aether/client/renderer/entity/MimicRenderer.java View File

@@ -21,7 +21,7 @@ public class MimicRenderer extends MobRenderer<MimicEntity, MimicModel> {
private boolean isChristmas;
public MimicRenderer(EntityRendererManager rendererManager) {
super(rendererManager, new MimicModel(), 1.0f);
super(rendererManager, new MimicModel(), 1.0F);
Calendar calendar = Calendar.getInstance();
if (calendar.get(Calendar.MONTH) == Calendar.DECEMBER && calendar.get(Calendar.DAY_OF_MONTH) >= 24 && calendar.get(Calendar.DAY_OF_MONTH) <= 26) {
this.isChristmas = true;


+ 1
- 1
src/main/java/com/aether/client/renderer/entity/MoaRenderer.java View File

@@ -36,7 +36,7 @@ public class MoaRenderer extends MobRenderer<MoaEntity, MoaModel>{
@Override
protected void preRenderCallback(MoaEntity moa, MatrixStack matrixStackIn, float partialTickTime) {
float moaScale = moa.isChild()? 1.0f : 1.8f;
float moaScale = moa.isChild()? 1.0F : 1.8F;
matrixStackIn.scale(moaScale, moaScale, moaScale);
}



+ 4
- 4
src/main/java/com/aether/client/renderer/entity/SentryRenderer.java View File

@@ -19,7 +19,7 @@ public class SentryRenderer extends MobRenderer<SentryEntity, SlimeModel<SentryE
private static final ResourceLocation SENTRY_TEXTURES_LIT = new ResourceLocation(Aether.MODID, "textures/entity/sentry/sentry_lit.png");
public SentryRenderer(EntityRendererManager rendererManager) {
super(rendererManager, new SlimeModel<>(0), 0.3f);
super(rendererManager, new SlimeModel<>(0), 0.3F);
this.addLayer(new SentryLayer<>(this));
}

@@ -30,11 +30,11 @@ public class SentryRenderer extends MobRenderer<SentryEntity, SlimeModel<SentryE
@Override
protected void preRenderCallback(SentryEntity entitylivingbaseIn, MatrixStack matrixStackIn, float partialTickTime) {
// GL11.glScalef(1.75f, 1.75f, 1.75f);
float f = 0.879f;
// GL11.glScalef(1.75F, 1.75F, 1.75F);
float f = 0.879F;
matrixStackIn.scale(f, f, f);
float f1 = entitylivingbaseIn.getSlimeSize();
float f2 = 0.0f;// /*MathHelper.lerp(partialTickTime, entitylivingbaseIn.prevSquishFactor, entitylivingbaseIn.squishFactor)*/ / (f1 * 0.5F + 1.0F);
float f2 = 0.0F;// /*MathHelper.lerp(partialTickTime, entitylivingbaseIn.prevSquishFactor, entitylivingbaseIn.squishFactor)*/ / (f1 * 0.5F + 1.0F);
float f3 = 1.0F / (f2 + 1.0F);
matrixStackIn.scale(f3 * f1, 1.0F / f3 * f1, f3 * f1);
}


+ 2
- 2
src/main/java/com/aether/client/renderer/entity/ZephyrRenderer.java View File

@@ -29,12 +29,12 @@ public class ZephyrRenderer extends MobRenderer<ZephyrEntity, ZephyrModel> {
float f2 = (8.0F + f1) / 2.0F;
float f3 = (8.0F + 1.0F / f1) / 2.0F;
matrixStackIn.scale(f3, f2, f3);
matrixStackIn.translate(0, 0.5D, 0);
matrixStackIn.translate(0, 0.5, 0);

/*if (AetherConfig.visual_options.legacy_models) TODO: Re-enable this when the config is put back in.
{
matrixStackIn.scale(0.8F, 0.8F, 0.8F);
matrixStackIn.translate(0, -0.1D, 0);
matrixStackIn.translate(0, -0.1, 0);
}*/

}


+ 4
- 4
src/main/java/com/aether/client/renderer/entity/model/FlyingCowWingModel.java View File

@@ -42,10 +42,10 @@ public class FlyingCowWingModel extends EntityModel<FlyingCowEntity> {
this.leftWingOuter.setRotationPoint(4.0F + x2, y2 + 12.0F, 0.0F);
this.rightWingOuter.setRotationPoint(-4.0F - x2, y2 + 12.0F, 0.0F);

this.leftWingInner.rotateAngleZ = flyingCow.wingAngle + wingBend + ((float)Math.PI / 2F);
this.leftWingOuter.rotateAngleZ = flyingCow.wingAngle - wingBend + ((float)Math.PI / 2F);
this.rightWingInner.rotateAngleZ = -(flyingCow.wingAngle + wingBend - ((float)Math.PI / 2F));
this.rightWingOuter.rotateAngleZ = -(flyingCow.wingAngle - wingBend + ((float)Math.PI / 2F));
this.leftWingInner.rotateAngleZ = flyingCow.wingAngle + wingBend + ((float)Math.PI / 2.0F);
this.leftWingOuter.rotateAngleZ = flyingCow.wingAngle - wingBend + ((float)Math.PI / 2.0F);
this.rightWingInner.rotateAngleZ = -(flyingCow.wingAngle + wingBend - ((float)Math.PI / 2.0F));
this.rightWingOuter.rotateAngleZ = -(flyingCow.wingAngle - wingBend + ((float)Math.PI / 2.0F));
}

@Override


+ 29
- 29
src/main/java/com/aether/client/renderer/entity/model/MimicModel.java View File

@@ -23,33 +23,33 @@ public class MimicModel extends EntityModel<MimicEntity> {
this.textureHeight = 64;
this.upperBody = new ModelRenderer(this, 0, 10);
this.upperBody.setRotationPoint(-8.0f, 0.0f, 8.0f);
this.upperBody.addBox(0.0f, 0.0f, 0.0f, 16, 6, 16);
this.upperBody.setRotationPoint(-8.0F, 0.0F, 8.0F);
this.upperBody.addBox(0.0F, 0.0F, 0.0F, 16, 6, 16);
this.upperBody.rotateAngleX = (float) Math.PI;
this.lowerBody = new ModelRenderer(this, 0, 38);
this.lowerBody.setRotationPoint(-8.0f, 0.0f, -8.0f);
this.lowerBody.addBox(0.0f, 0.0f, 0.0f, 16, 10, 16);
this.lowerBody.setRotationPoint(-8.0F, 0.0F, -8.0F);
this.lowerBody.addBox(0.0F, 0.0F, 0.0F, 16, 10, 16);
this.leftLeg = new ModelRenderer(this, 64, 0);
this.leftLeg.setRotationPoint(1.5f, 9.0f, 0.0f);
this.leftLeg.addBox(0.0f, 0.0f, -3.0f, 6, 15, 6);
this.leftLeg.setRotationPoint(1.5F, 9.0F, 0.0F);
this.leftLeg.addBox(0.0F, 0.0F, -3.0F, 6, 15, 6);
this.rightLeg = new ModelRenderer(this, 64, 0);
this.rightLeg.mirror = true;
this.rightLeg.setRotationPoint(-2.5f, 9.0f, 0.0f);
this.rightLeg.addBox(-5.1f, 0.0f, -3.0f, 6, 15, 6);
this.rightLeg.setRotationPoint(-2.5F, 9.0F, 0.0F);
this.rightLeg.addBox(-5.1F, 0.0F, -3.0F, 6, 15, 6);
this.knob = new ModelRenderer(this, 0, 0);
this.knob.setRotationPoint(0.0f, 0.0f, 0.0f);
this.knob.addBox(7.0f, -2.0f, 16.0f, 2, 4, 1);
this.knob.setRotationPoint(0.0F, 0.0F, 0.0F);
this.knob.addBox(7.0F, -2.0F, 16.0F, 2, 4, 1);
this.upperBody.addChild(knob);
}
@Override
public void render(MatrixStack matrixStackIn, IVertexBuilder bufferIn, int packedLightIn, int packedOverlayIn, float red, float green, float blue, float alpha) {
// this.knob.offsetX = 0.5f;
// this.knob.offsetY = 0.0f;
// this.knob.offsetX = 0.5F;
// this.knob.offsetY = 0.0F;
this.upperBody.render(matrixStackIn, bufferIn, packedLightIn, packedOverlayIn);
this.lowerBody.render(matrixStackIn, bufferIn, packedLightIn, packedOverlayIn);
@@ -59,36 +59,36 @@ public class MimicModel extends EntityModel<MimicEntity> {
@Override
public void setRotationAngles(MimicEntity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) {
this.upperBody.rotateAngleX = (float) Math.PI - 0.6f * (1.0f + MathHelper.cos(ageInTicks / 10.0f * (float) Math.PI));
this.upperBody.rotateAngleX = (float) Math.PI - 0.6F * (1.0F + MathHelper.cos(ageInTicks / 10.0F * (float) Math.PI));
if (this.isSitting) {
this.rightLeg.rotateAngleX = -1.4137167f;
this.rightLeg.rotateAngleY = (float)Math.PI / 10.0f;
this.rightLeg.rotateAngleZ = 0.07853982f;
this.leftLeg.rotateAngleX = -1.4137167f;
this.leftLeg.rotateAngleY = -(float)Math.PI / 10.0f;
this.leftLeg.rotateAngleZ = -0.07853982f;
this.rightLeg.rotateAngleX = -1.4137167F;
this.rightLeg.rotateAngleY = (float)Math.PI / 10.0F;
this.rightLeg.rotateAngleZ = 0.07853982F;
this.leftLeg.rotateAngleX = -1.4137167F;
this.leftLeg.rotateAngleY = -(float)Math.PI / 10.0F;
this.leftLeg.rotateAngleZ = -0.07853982F;
}
else {
boolean isFlyingWithElytra = entityIn.getTicksElytraFlying() > 4;
float limbSwingLimiter = 1.0f;
float limbSwingLimiter = 1.0F;
if (isFlyingWithElytra) {
limbSwingLimiter = (float) entityIn.getMotion().lengthSquared();
limbSwingLimiter /= 0.2f;
limbSwingLimiter /= 0.2F;
limbSwingLimiter = limbSwingLimiter * limbSwingLimiter * limbSwingLimiter;
if (limbSwingLimiter < 1.0f) {
limbSwingLimiter = 1.0f;
if (limbSwingLimiter < 1.0F) {
limbSwingLimiter = 1.0F;
}
}
this.rightLeg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662f) * 1.4f * limbSwingAmount / limbSwingLimiter;
this.leftLeg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662f + (float)Math.PI) * 1.4f * limbSwingAmount / limbSwingLimiter;
this.rightLeg.rotateAngleY = 0.0f;
this.leftLeg.rotateAngleY = 0.0f;
this.rightLeg.rotateAngleZ = 0.0f;
this.leftLeg.rotateAngleZ = 0.0f;
this.rightLeg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount / limbSwingLimiter;
this.leftLeg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI) * 1.4F * limbSwingAmount / limbSwingLimiter;
this.rightLeg.rotateAngleY = 0.0F;
this.leftLeg.rotateAngleY = 0.0F;
this.rightLeg.rotateAngleZ = 0.0F;
this.leftLeg.rotateAngleZ = 0.0F;
}
}


+ 11
- 11
src/main/java/com/aether/client/renderer/entity/model/MoaModel.java View File

@@ -81,10 +81,10 @@ public class MoaModel extends EntityModel<MoaEntity> {
this.legs2.rotateAngleX = MathHelper.cos((float)(limbSwing * 0.6662F + Math.PI)) * 1.4F * limbSwingAmount;

if (ageInTicks > 0.001F) {
this.wings.rotationPointZ = -1F;
this.wings2.rotationPointZ = -1F;
this.wings.rotationPointY = 12F;
this.wings2.rotationPointY = 12F;
this.wings.rotationPointZ = -1.0F;
this.wings2.rotationPointZ = -1.0F;
this.wings.rotationPointY = 12.0F;
this.wings2.rotationPointY = 12.0F;
this.wings.rotateAngleX = 0.0F;
this.wings2.rotateAngleX = 0.0F;
this.wings.rotateAngleZ = ageInTicks;
@@ -93,10 +93,10 @@ public class MoaModel extends EntityModel<MoaEntity> {
this.legs2.rotateAngleX = 0.6F;
}
else {
this.wings.rotationPointZ = -3F;
this.wings2.rotationPointZ = -3F;
this.wings.rotationPointY = 14F;
this.wings2.rotationPointY = 14F;
this.wings.rotationPointZ = -3.0F;
this.wings2.rotationPointZ = -3.0F;
this.wings.rotationPointY = 14.0F;
this.wings2.rotationPointY = 14.0F;
this.wings.rotateAngleX = (float)(Math.PI / 2.0F);
this.wings2.rotateAngleX = (float)(Math.PI / 2.0F);
this.wings.rotateAngleZ = 0.0F;
@@ -115,10 +115,10 @@ public class MoaModel extends EntityModel<MoaEntity> {
this.feather3.setRotationPoint(0.0F, 1 + 24, 1.0F);

this.jaw.rotateAngleX = -0.3F;
this.head.rotateAngleX = 0F;
this.head.rotateAngleX = 0.0F;

this.wings.rotationPointY = 22F;
this.wings2.rotationPointY = 22F;
this.wings.rotationPointY = 22.0F;
this.wings2.rotationPointY = 22.0F;
}
else {
this.head.setRotationPoint(0.0F, -8 + 16, -4.0F);


+ 8
- 8
src/main/java/com/aether/client/renderer/entity/model/PhygWingModel.java View File

@@ -51,10 +51,10 @@ public class PhygWingModel extends EntityModel<PhygEntity> {
this.leftWingOuter.setRotationPoint(4.0F + y2, y21 + 12.0F, x2);
this.rightWingOuter.setRotationPoint(-4.0F - y2, y21 + 12.0F, x2);

this.leftWingInner.rotateAngleZ = phyg.wingAngle + wingBend + ((float) Math.PI / 2F);
this.leftWingOuter.rotateAngleZ = phyg.wingAngle - wingBend + ((float) Math.PI / 2F);
this.rightWingInner.rotateAngleZ = -(phyg.wingAngle + wingBend - ((float) Math.PI / 2F));
this.rightWingOuter.rotateAngleZ = -(phyg.wingAngle - wingBend + ((float) Math.PI / 2F));
this.leftWingInner.rotateAngleZ = phyg.wingAngle + wingBend + ((float) Math.PI / 2.0F);
this.leftWingOuter.rotateAngleZ = phyg.wingAngle - wingBend + ((float) Math.PI / 2.0F);
this.rightWingInner.rotateAngleZ = -(phyg.wingAngle + wingBend - ((float) Math.PI / 2.0F));
this.rightWingOuter.rotateAngleZ = -(phyg.wingAngle - wingBend + ((float) Math.PI / 2.0F));
}
else {
wingBend = -((float)Math.acos((double)phyg.wingFold));
@@ -74,10 +74,10 @@ public class PhygWingModel extends EntityModel<PhygEntity> {
this.leftWingOuter.setRotationPoint(4.0F + x2, y2 + 12.0F, z);
this.rightWingOuter.setRotationPoint(-4.0F - x2, y2 + 12.0F, z);

this.leftWingInner.rotateAngleZ = phyg.wingAngle + wingBend + ((float)Math.PI / 2F);
this.leftWingOuter.rotateAngleZ = phyg.wingAngle - wingBend + ((float)Math.PI / 2F);
this.rightWingInner.rotateAngleZ = -(phyg.wingAngle + wingBend - ((float)Math.PI / 2F));
this.rightWingOuter.rotateAngleZ = -(phyg.wingAngle - wingBend + ((float)Math.PI / 2F));
this.leftWingInner.rotateAngleZ = phyg.wingAngle + wingBend + ((float)Math.PI / 2.0F);
this.leftWingOuter.rotateAngleZ = phyg.wingAngle - wingBend + ((float)Math.PI / 2.0F);
this.rightWingInner.rotateAngleZ = -(phyg.wingAngle + wingBend - ((float)Math.PI / 2.0F));
this.rightWingOuter.rotateAngleZ = -(phyg.wingAngle - wingBend + ((float)Math.PI / 2.0F));

}
}


+ 2
- 2
src/main/java/com/aether/client/renderer/entity/model/ZephyrModel.java View File

@@ -71,7 +71,7 @@ public class ZephyrModel extends EntityModel<ZephyrEntity> {
Tail2.setRotationPoint(0.0F, 0.0F, 6.0F);
Tail1.addChild(Tail2);
Tail2.setTextureOffset(80, 24);
Tail2.addBox(-2F, -2F, -1.966667F, 4, 4, 4, 0.0F, false);
Tail2.addBox(-2.0F, -2.0F, -1.966667F, 4, 4, 4, 0.0F, false);

Tail3 = new ModelRenderer(this);
Tail3.setRotationPoint(0.0F, 0.0F, 5.0F);
@@ -82,7 +82,7 @@ public class ZephyrModel extends EntityModel<ZephyrEntity> {

@Override
public void setRotationAngles(ZephyrEntity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) {
float motion = (float)(Math.sin(limbSwing * 20 / 57.2957795) * limbSwingAmount * .5F);
float motion = (float)(Math.sin(limbSwing * 20 / 57.2957795) * limbSwingAmount * 0.5F);

this.LeftFace.rotationPointY = motion + 8;
this.LeftFace.rotationPointX = motion * 0.5F;


+ 1
- 1
src/main/java/com/aether/entity/AetherEntityTypes.java View File

@@ -25,7 +25,7 @@ import net.minecraftforge.registries.ObjectHolder;
@ObjectHolder(Aether.MODID)
public class AetherEntityTypes {

public static final EntityType<MimicEntity> MIMIC = EntityType.Builder.<MimicEntity>create(MimicEntity::new, EntityClassification.MONSTER).size(1.0f, 2.0f).build("mimic");
public static final EntityType<MimicEntity> MIMIC = EntityType.Builder.<MimicEntity>create(MimicEntity::new, EntityClassification.MONSTER).size(1.0F, 2.0F).build("mimic");
public static final EntityType<SentryEntity> SENTRY = EntityType.Builder.<SentryEntity>create(SentryEntity::new, EntityClassification.MONSTER).size(2.0F, 2.0F).build("sentry");
public static final EntityType<ZephyrEntity> ZEPHYR = EntityType.Builder.<ZephyrEntity>create(ZephyrEntity::new, EntityClassification.MONSTER).size(4.0F, 4.0F).build("zephyr");
//public static final EntityType<ValkyrieEntity> VALKYRIE = null;


+ 8
- 8
src/main/java/com/aether/entity/item/FloatingBlockEntity.java View File

@@ -53,7 +53,7 @@ public class FloatingBlockEntity extends Entity implements IEntityAdditionalSpaw
private boolean dontSetBlock;
private boolean hurtEntities;
private int floatHurtMax = 40;
private float floatHurtAmount = 2.0f;
private float floatHurtAmount = 2.0F;
public CompoundNBT tileEntityData;
protected static final DataParameter<BlockPos> ORIGIN = EntityDataManager.createKey(FloatingBlockEntity.class, DataSerializers.BLOCK_POS);
@@ -69,7 +69,7 @@ public class FloatingBlockEntity extends Entity implements IEntityAdditionalSpaw
this(AetherEntityTypes.FLOATING_BLOCK, worldIn);
this.floatTile = floatingBlockState;
this.preventEntitySpawning = true;
this.setPosition(x, y + (1.0f - this.getHeight()) / 2.0f, z);
this.setPosition(x, y + (1.0F - this.getHeight()) / 2.0F, z);
this.setMotion(Vec3d.ZERO);
this.prevPosX = x;
this.prevPosY = y;
@@ -130,7 +130,7 @@ public class FloatingBlockEntity extends Entity implements IEntityAdditionalSpaw
}

if (!this.hasNoGravity()) {
this.setMotion(this.getMotion().add(0.0D, 0.04D, 0.0D));
this.setMotion(this.getMotion().add(0.0, 0.04, 0.0));
}

this.move(MoverType.SELF, this.getMotion());
@@ -139,7 +139,7 @@ public class FloatingBlockEntity extends Entity implements IEntityAdditionalSpaw
boolean flag = this.floatTile.getBlock() instanceof ConcretePowderBlock;
boolean flag1 = flag && this.world.getFluidState(blockpos1).isTagged(FluidTags.WATER);
double d0 = this.getMotion().lengthSquared();
if (flag && d0 > 1.0D) {
if (flag && d0 > 1.0) {
BlockRayTraceResult blockraytraceresult = this.world
.rayTraceBlocks(new RayTraceContext(new Vec3d(this.prevPosX, this.prevPosY, this.prevPosZ),
new Vec3d(this.getPosX(), this.getPosY(), this.getPosZ()), RayTraceContext.BlockMode.COLLIDER,
@@ -162,7 +162,7 @@ public class FloatingBlockEntity extends Entity implements IEntityAdditionalSpaw
}
else {
BlockState blockstate = this.world.getBlockState(blockpos1);
this.setMotion(this.getMotion().mul(0.7D, 1.5D, 0.7D));
this.setMotion(this.getMotion().mul(0.7, 1.5, 0.7));
if (blockstate.getBlock() != Blocks.MOVING_PISTON) {
this.remove();
if (!this.dontSetBlock) {
@@ -210,14 +210,14 @@ public class FloatingBlockEntity extends Entity implements IEntityAdditionalSpaw
}
}

this.setMotion(this.getMotion().scale(0.98D));
this.setMotion(this.getMotion().scale(0.98));
}
}
@Override
public boolean onLivingFall(float distance, float damageMultiplier) {
if (this.hurtEntities) {
int i = MathHelper.ceil(distance - 1.0f);
int i = MathHelper.ceil(distance - 1.0F);
if (i > 0) {
List<Entity> list = Lists.newArrayList(this.world.getEntitiesWithinAABBExcludingEntity(this, this.getBoundingBox()));
boolean flag = this.floatTile.isIn(BlockTags.ANVIL);
@@ -227,7 +227,7 @@ public class FloatingBlockEntity extends Entity implements IEntityAdditionalSpaw
entity.attackEntityFrom(damagesource, Math.min(MathHelper.floor(i * this.floatHurtAmount), this.floatHurtMax));
}
if (flag && this.rand.nextFloat() < 0.05f + i * 0.05f) {
if (flag && this.rand.nextFloat() < 0.05F + i * 0.05F) {
BlockState blockstate = AnvilBlock.damage(this.floatTile);
if (blockstate == null) {
this.dontSetBlock = true;


+ 1
- 1
src/main/java/com/aether/entity/monster/MimicEntity.java View File

@@ -85,7 +85,7 @@ public class MimicEntity extends CreatureEntity {
if (entityIn instanceof LivingEntity) {
// If the entity died as a result of this attack, then play the burp sound. Otherwise, play the eating sound.
SoundEvent sound = (((LivingEntity) entityIn).getHealth() <= 0.0)? SoundEvents.ENTITY_PLAYER_BURP : SoundEvents.ENTITY_GENERIC_EAT;
this.playSound(sound, 1.0f, this.getSoundPitch());
this.playSound(sound, 1.0F, this.getSoundPitch());
}
return result;


+ 7
- 7
src/main/java/com/aether/entity/monster/SentryEntity.java View File

@@ -32,7 +32,7 @@ import net.minecraft.world.World;
public class SentryEntity extends SlimeEntity {
public static final DataParameter<Boolean> SENTRY_AWAKE = EntityDataManager.createKey(SentryEntity.class, DataSerializers.BOOLEAN);
public float timeSpotted = 0.0f;
public float timeSpotted = 0.0F;
public SentryEntity(EntityType<? extends SentryEntity> type, World worldIn) {
super(type, worldIn);
@@ -50,7 +50,7 @@ public class SentryEntity extends SlimeEntity {
this.goalSelector.addGoal(5, new SentryEntity.HopGoal(this));
this.targetSelector.addGoal(1,
new NearestAttackableTargetGoal<>(this, PlayerEntity.class, 10, true, false, (p_213811_1_) -> {
return Math.abs(p_213811_1_.getPosY() - this.getPosY()) <= 4.0D;
return Math.abs(p_213811_1_.getPosY() - this.getPosY()) <= 4.0;
}));
this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, IronGolemEntity.class, true));
}
@@ -105,12 +105,12 @@ public class SentryEntity extends SlimeEntity {
}
protected void explodeAt(LivingEntity entityIn) {
if (this.isAwake() && this.canEntityBeSeen(entityIn) && entityIn.attackEntityFrom(DamageSource.causeMobDamage(this), 1.0f) && this.ticksExisted > 20) {
if (this.isAwake() && this.canEntityBeSeen(entityIn) && entityIn.attackEntityFrom(DamageSource.causeMobDamage(this), 1.0F) && this.ticksExisted > 20) {
entityIn.addVelocity(0.5, 0.5, 0.5);
this.world.createExplosion(this, this.getPosX(), this.getPosY(), this.getPosZ(), 0.1f, Explosion.Mode.DESTROY);
this.setHealth(0.0f);
this.playSound(SoundEvents.ENTITY_GENERIC_EXPLODE, 1.0f, 0.2f*(this.rand.nextFloat() - this.rand.nextFloat()) + 1);
this.world.createExplosion(this, this.getPosX(), this.getPosY(), this.getPosZ(), 0.1F, Explosion.Mode.DESTROY);
this.setHealth(0.0F);
this.playSound(SoundEvents.ENTITY_GENERIC_EXPLODE, 1.0F, 0.2F*(this.rand.nextFloat() - this.rand.nextFloat()) + 1);
this.applyEnchantments(this, entityIn);
}
}
@@ -124,7 +124,7 @@ public class SentryEntity extends SlimeEntity {
@Override
public ILivingEntityData onInitialSpawn(IWorld worldIn, DifficultyInstance difficultyIn, SpawnReason reason, ILivingEntityData spawnDataIn, CompoundNBT dataTag) {
this.getAttribute(SharedMonsterAttributes.FOLLOW_RANGE).applyModifier(new AttributeModifier("Random spawn bonus", this.rand.nextGaussian() * 0.05D, AttributeModifier.Operation.MULTIPLY_BASE));
this.getAttribute(SharedMonsterAttributes.FOLLOW_RANGE).applyModifier(new AttributeModifier("Random spawn bonus", this.rand.nextGaussian() * 0.05, AttributeModifier.Operation.MULTIPLY_BASE));
if (this.rand.nextFloat() < 0.05F) {
this.setLeftHanded(true);
}


+ 3
- 3
src/main/java/com/aether/entity/monster/ZephyrEntity.java View File

@@ -237,7 +237,7 @@ public class ZephyrEntity extends FlyingEntity implements IMob {
double d1 = movementcontroller.getY() - this.parentEntity.getPosY();
double d2 = movementcontroller.getZ() - this.parentEntity.getPosZ();
double d3 = d0 * d0 + d1 * d1 + d2 * d2;
return d3 < 1.0D || d3 > 3600.0D;
return d3 < 1.0 || d3 > 3600.0;
}
}

@@ -258,7 +258,7 @@ public class ZephyrEntity extends FlyingEntity implements IMob {
double d0 = this.parentEntity.getPosX() + (random.nextFloat() * 2.0F - 1.0F) * 16.0F;
double d1 = this.parentEntity.getPosY() + (random.nextFloat() * 2.0F - 1.0F) * 16.0F;
double d2 = this.parentEntity.getPosZ() + (random.nextFloat() * 2.0F - 1.0F) * 16.0F;
this.parentEntity.getMoveHelper().setMoveTo(d0, d1, d2, 1.0D);
this.parentEntity.getMoveHelper().setMoveTo(d0, d1, d2, 1.0);
}
}

@@ -283,7 +283,7 @@ public class ZephyrEntity extends FlyingEntity implements IMob {
double d0 = vec3d.length();
vec3d = vec3d.normalize();
if (this.isNotColliding(vec3d, MathHelper.ceil(d0))) {
this.parentEntity.setMotion(this.parentEntity.getMotion().add(vec3d.scale(0.1D)));
this.parentEntity.setMotion(this.parentEntity.getMotion().add(vec3d.scale(0.1)));
}
else {
this.action = MovementController.Action.WAIT;


+ 13
- 13
src/main/java/com/aether/entity/passive/FlyingCowEntity.java View File

@@ -40,23 +40,23 @@ public class FlyingCowEntity extends SaddleableEntity {
@Override
protected void registerAttributes() {
super.registerAttributes();
this.getAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.20000000298023224D);
this.getAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.20000000298023224);
if (!this.isSaddled()) {
this.getAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(10.0D);
this.getAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(10.0);
}
else {
this.getAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(20.0D);
this.getAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(20.0);
}
}

@Override
protected void registerGoals() {
this.goalSelector.addGoal(0, new SwimGoal(this));
this.goalSelector.addGoal(1, new PanicGoal(this, 2.0D));
this.goalSelector.addGoal(2, new BreedGoal(this, 1.0D));
this.goalSelector.addGoal(3, new TemptGoal(this, 1.25D, Ingredient.fromItems(AetherItems.BLUEBERRY), false));
this.goalSelector.addGoal(4, new FollowParentGoal(this, 1.25D));
this.goalSelector.addGoal(5, new WaterAvoidingRandomWalkingGoal(this, 1.0D));
this.goalSelector.addGoal(1, new PanicGoal(this, 2.0));
this.goalSelector.addGoal(2, new BreedGoal(this, 1.0));
this.goalSelector.addGoal(3, new TemptGoal(this, 1.25, Ingredient.fromItems(AetherItems.BLUEBERRY), false));
this.goalSelector.addGoal(4, new FollowParentGoal(this, 1.25));
this.goalSelector.addGoal(5, new WaterAvoidingRandomWalkingGoal(this, 1.0));
this.goalSelector.addGoal(6, new LookAtGoal(this, PlayerEntity.class, 6.0F));
this.goalSelector.addGoal(7, new LookRandomlyGoal(this));
}
@@ -75,12 +75,12 @@ public class FlyingCowEntity extends SaddleableEntity {
ticks++;

this.wingAngle = this.wingFold * (float) Math.sin(this.ticks / 31.83098862F);
this.wingFold += (aimingForFold - this.wingFold) / 5F;
this.wingFold += (aimingForFold - this.wingFold) / 5.0F;
this.fallDistance = 0.0F;

this.fallDistance = 0.0F;
if (this.getMotion().y < -0.1D && !this.isRiderSneaking()) {
this.setMotion(getMotion().x, -0.1D, getMotion().z);
if (this.getMotion().y < -0.1 && !this.isRiderSneaking()) {
this.setMotion(getMotion().x, -0.1, getMotion().z);
}
}

@@ -128,11 +128,11 @@ public class FlyingCowEntity extends SaddleableEntity {
public void setSaddled(boolean flag) {
super.setSaddled(flag);
if(flag) {
this.getAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(20.0D);
this.getAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(20.0);
this.setHealth(20.0F);
}
else {
this.getAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(10.0D);
this.getAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(10.0);
this.setHealth(10.0F);
}
}


+ 1
- 1
src/main/java/com/aether/entity/passive/MoaEntity.java View File

@@ -108,7 +108,7 @@ public class MoaEntity extends SaddleableEntity {

this.goalSelector.addGoal(0, new SwimGoal(this));
this.goalSelector.addGoal(1, new PanicGoal(this, 1.4));
this.goalSelector.addGoal(2, new WaterAvoidingRandomWalkingGoal(this, 0.30F));
this.goalSelector.addGoal(2, new WaterAvoidingRandomWalkingGoal(this, 0.3F));
//TODO this.goalSelector.addGoal(2, new TemptGoal(this, 1.25, Ingredient.fromItems(AetherItems.NATURE_STAFF), false));
this.goalSelector.addGoal(4, new LookAtGoal(this, PlayerEntity.class, 6.0F));
this.goalSelector.addGoal(5, new LookAtGoal(this, PlayerEntity.class, 6.0F));


+ 13
- 13
src/main/java/com/aether/entity/passive/PhygEntity.java View File

@@ -28,11 +28,11 @@ public class PhygEntity extends SaddleableEntity {
@Override
protected void registerGoals() {
this.goalSelector.addGoal(0, new SwimGoal(this));
this.goalSelector.addGoal(1, new PanicGoal(this, 1.25D));
this.goalSelector.addGoal(3, new BreedGoal(this, 1.0D));
this.goalSelector.addGoal(4, new TemptGoal(this, 1.2D, Ingredient.fromItems(AetherItems.BLUEBERRY), false));
this.goalSelector.addGoal(5, new FollowParentGoal(this, 1.1D));
this.goalSelector.addGoal(6, new WaterAvoidingRandomWalkingGoal(this, 1.0D));
this.goalSelector.addGoal(1, new PanicGoal(this, 1.25));
this.goalSelector.addGoal(3, new BreedGoal(this, 1.0));
this.goalSelector.addGoal(4, new TemptGoal(this, 1.2, Ingredient.fromItems(AetherItems.BLUEBERRY), false));
this.goalSelector.addGoal(5, new FollowParentGoal(this, 1.1));
this.goalSelector.addGoal(6, new WaterAvoidingRandomWalkingGoal(this, 1.0));
this.goalSelector.addGoal(7, new LookAtGoal(this, PlayerEntity.class, 6.0F));
this.goalSelector.addGoal(8, new LookRandomlyGoal(this));
}
@@ -40,12 +40,12 @@ public class PhygEntity extends SaddleableEntity {
@Override
protected void registerAttributes() {
super.registerAttributes();
this.getAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D);
this.getAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25);
if (!this.isSaddled()) {
this.getAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(10.0D);
this.getAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(10.0);
}
else {
this.getAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(20.0D);
this.getAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(20.0);
}
}

@@ -62,11 +62,11 @@ public class PhygEntity extends SaddleableEntity {
}
ticks++;
this.wingAngle = this.wingFold * (float) Math.sin(this.ticks / 31.83098862F);
this.wingFold += (aimingForFold - this.wingFold) / 5F;
this.wingFold += (aimingForFold - this.wingFold) / 5.0F;

this.fallDistance = 0.0F;
if (this.getMotion().y < -0.1D && !this.isRiderSneaking()) {
this.setMotion(getMotion().x, -0.1D, getMotion().z);
if (this.getMotion().y < -0.1 && !this.isRiderSneaking()) {
this.setMotion(getMotion().x, -0.1, getMotion().z);
}
}

@@ -114,11 +114,11 @@ public class PhygEntity extends SaddleableEntity {
public void setSaddled(boolean flag) {
super.setSaddled(flag);
if(flag) {
this.getAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(20.0D);
this.getAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(20.0);
this.setHealth(20.0F);
}
else {
this.getAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(10.0D);
this.getAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(10.0);
this.setHealth(10.0F);
}
}


+ 13
- 13
src/main/java/com/aether/entity/passive/SheepuffEntity.java View File

@@ -100,12 +100,12 @@ public class SheepuffEntity extends AetherAnimalEntity implements IShearable {
protected void registerGoals() {
this.eatGrassGoal = new EatAetherGrassGoal(this);
this.goalSelector.addGoal(0, new SwimGoal(this));
this.goalSelector.addGoal(1, new PanicGoal(this, 1.25D));
this.goalSelector.addGoal(2, new BreedGoal(this, 1.0D));
this.goalSelector.addGoal(3, new TemptGoal(this, 1.1D, Ingredient.fromItems(Items.WHEAT), false));
this.goalSelector.addGoal(4, new FollowParentGoal(this, 1.1D));
this.goalSelector.addGoal(1, new PanicGoal(this, 1.25));
this.goalSelector.addGoal(2, new BreedGoal(this, 1.0));
this.goalSelector.addGoal(3, new TemptGoal(this, 1.1, Ingredient.fromItems(Items.WHEAT), false));
this.goalSelector.addGoal(4, new FollowParentGoal(this, 1.1));
this.goalSelector.addGoal(5, this.eatGrassGoal);
this.goalSelector.addGoal(6, new WaterAvoidingRandomWalkingGoal(this, 1.0D));
this.goalSelector.addGoal(6, new WaterAvoidingRandomWalkingGoal(this, 1.0));
this.goalSelector.addGoal(7, new LookAtGoal(this, PlayerEntity.class, 6.0F));
this.goalSelector.addGoal(8, new LookRandomlyGoal(this));
}
@@ -120,8 +120,8 @@ public class SheepuffEntity extends AetherAnimalEntity implements IShearable {
protected void registerAttributes()
{
super.registerAttributes();
this.getAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(8.0D);
this.getAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.23000000417232513D);
this.getAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(8.0);
this.getAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.23000000417232513);
}


@@ -156,9 +156,9 @@ public class SheepuffEntity extends AetherAnimalEntity implements IShearable {
public float getHeadRotationAngleX(float p_70890_1_) {
if (this.sheepTimer > 4 && this.sheepTimer <= 36) {
float f = (this.sheepTimer - 4 - p_70890_1_) / 32.0F;
return ((float)Math.PI / 5F) + 0.21991149F * MathHelper.sin(f * 28.7F);
return ((float)Math.PI / 5.0F) + 0.21991149F * MathHelper.sin(f * 28.7F);
} else {
return this.sheepTimer > 0 ? ((float)Math.PI / 5F) : this.rotationPitch * ((float)Math.PI / 180F);
return this.sheepTimer > 0 ? ((float)Math.PI / 5.0F) : this.rotationPitch * ((float)Math.PI / 180.0F);
}
}

@@ -278,11 +278,11 @@ public class SheepuffEntity extends AetherAnimalEntity implements IShearable {
{
if(this.getPuffed())
{
this.setMotion(getMotion().x + this.rand.nextGaussian() * 0.5D, 1.8D, getMotion().z + rand.nextGaussian() * 0.5D);
this.setMotion(getMotion().x + this.rand.nextGaussian() * 0.5, 1.8, getMotion().z + rand.nextGaussian() * 0.5);
}
else
{
this.setMotion(getMotion().x, 0.41999998688697815D, getMotion().z);
this.setMotion(getMotion().x, 0.41999998688697815, getMotion().z);
}
}

@@ -294,9 +294,9 @@ public class SheepuffEntity extends AetherAnimalEntity implements IShearable {
{
this.fallDistance = 0;

if(this.getMotion().y < -0.05D)
if(this.getMotion().y < -0.05)
{
this.setMotion(getMotion().x, -0.05D, getMotion().z);
this.setMotion(getMotion().x, -0.05, getMotion().z);
}
}



+ 1
- 1
src/main/java/com/aether/entity/projectile/ZephyrSnowballEntity.java View File

@@ -50,7 +50,7 @@ public class ZephyrSnowballEntity extends AbstractFireballEntity {
}

if (!livingEntity.isActiveItemStackBlocking()) {
entity.setMotion(entity.getMotion().x, entity.getMotion().y + 0.5D, entity.getMotion().z);
entity.setMotion(entity.getMotion().x, entity.getMotion().y + 0.5, entity.getMotion().z);
}
else {
ItemStack activeItemStack = livingEntity.getActiveItemStack();


+ 5
- 5
src/main/java/com/aether/item/AetherArmorMaterial.java View File

@@ -17,15 +17,15 @@ public enum AetherArmorMaterial implements IArmorMaterial {
Ingredient.fromItems(AetherItems.ZANITE_GEMSTONE)),
GRAVITITE("gravitite", 33, new int[] { 3, 6, 8, 3 }, 10, SoundEvents.ITEM_ARMOR_EQUIP_DIAMOND, 2.0F,
Ingredient.fromItems(AetherBlocks.ENCHANTED_GRAVITITE)),
VALKYRIE("valkyrie", 33, new int[] { 3, 6, 8, 3 }, 10, SoundEvents.ITEM_ARMOR_EQUIP_GOLD, 0.0f,
VALKYRIE("valkyrie", 33, new int[] { 3, 6, 8, 3 }, 10, SoundEvents.ITEM_ARMOR_EQUIP_GOLD, 0.0F,
Ingredient.EMPTY),
NEPTUNE("neptune", 33, new int[] { 3, 6, 8, 3 }, 10, SoundEvents.ITEM_ARMOR_EQUIP_DIAMOND, 0.0f,
NEPTUNE("neptune", 33, new int[] { 3, 6, 8, 3 }, 10, SoundEvents.ITEM_ARMOR_EQUIP_DIAMOND, 0.0F,
Ingredient.EMPTY),
PHOENIX("phoenix", 33, new int[] { 3, 6, 8, 3 }, 10, SoundEvents.ITEM_ARMOR_EQUIP_CHAIN, 0.0f,
PHOENIX("phoenix", 33, new int[] { 3, 6, 8, 3 }, 10, SoundEvents.ITEM_ARMOR_EQUIP_CHAIN, 0.0F,
Ingredient.EMPTY),
OBSIDIAN("obsidian", 33, new int[] { 3, 6, 8, 3 }, 10, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 0.0f,
OBSIDIAN("obsidian", 33, new int[] { 3, 6, 8, 3 }, 10, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 0.0F,
Ingredient.fromItems(Blocks.OBSIDIAN)),
SENTRY("sentry", 33, new int[] { 3, 6, 8, 3 }, 10, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 0.0f,
SENTRY("sentry", 33, new int[] { 3, 6, 8, 3 }, 10, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 0.0F,
Ingredient.EMPTY);

private static final int[] MAX_DAMAGE_ARRAY = new int[] { 13, 15, 16, 11 };


+ 5
- 5
src/main/java/com/aether/item/AetherItemTier.java View File

@@ -7,11 +7,11 @@ import net.minecraft.item.crafting.Ingredient;
import net.minecraft.tags.ItemTags;

public enum AetherItemTier implements IItemTier {
SKYROOT(0, 59, 2.0f, 0.0f, 15, Ingredient.fromTag(ItemTags.PLANKS)),
HOLYSTONE(1, 131, 4.0f, 1.0f, 5, Ingredient.fromItems(AetherBlocks.HOLYSTONE)),
ZANITE(2, 250, 6.0f, 2.0f, 14, Ingredient.fromItems(AetherItems.ZANITE_GEMSTONE)),
GRAVITITE(3, 1561, 8.0f, 3.0f, 10, Ingredient.fromItems(AetherBlocks.ENCHANTED_GRAVITITE)),
VALKYRIE(3, 1561, 8.0f, 3.0f, 22, Ingredient.EMPTY);
SKYROOT(0, 59, 2.0F, 0.0F, 15, Ingredient.fromTag(ItemTags.PLANKS)),
HOLYSTONE(1, 131, 4.0F, 1.0F, 5, Ingredient.fromItems(AetherBlocks.HOLYSTONE)),
ZANITE(2, 250, 6.0F, 2.0F, 14, Ingredient.fromItems(AetherItems.ZANITE_GEMSTONE)),
GRAVITITE(3, 1561, 8.0F, 3.0F, 10, Ingredient.fromItems(AetherBlocks.ENCHANTED_GRAVITITE)),
VALKYRIE(3, 1561, 8.0F, 3.0F, 22, Ingredient.EMPTY);

private final int harvestLevel;
private final int maxUses;


+ 31
- 31
src/main/java/com/aether/item/AetherItems.java View File

@@ -173,35 +173,35 @@ public class AetherItems {
item("zanite_gemstone", new Item(new Item.Properties().group(AetherItemGroups.AETHER_MATERIALS))),
item("ambrosium_shard", new AmbrosiumShardItem(new Item.Properties()
.food(new Food.Builder().setAlwaysEdible().fastToEat()
.effect(() -> new EffectInstance(Effects.INSTANT_HEALTH), 1.0f).build())
.effect(() -> new EffectInstance(Effects.INSTANT_HEALTH), 1.0F).build())
.group(AetherItemGroups.AETHER_MATERIALS))),
item("golden_amber", new Item(new Item.Properties().group(AetherItemGroups.AETHER_MATERIALS))),
item("aechor_petal", new Item(new Item.Properties().group(AetherItemGroups.AETHER_MATERIALS))),
item("swetty_ball", new SwettyBallItem(new Item.Properties().group(AetherItemGroups.AETHER_MATERIALS))),
item("skyroot_shovel", new ShovelItem(AetherItemTier.SKYROOT, 1.5f, -3.0f, new Item.Properties().group(AetherItemGroups.AETHER_TOOLS))),
item("skyroot_pickaxe", new PickaxeItem(AetherItemTier.SKYROOT, 1, -2.8f, new Item.Properties().group(AetherItemGroups.AETHER_TOOLS))),
item("skyroot_axe", new AxeItem(AetherItemTier.SKYROOT, 6.0f, -3.2f, new Item.Properties().group(AetherItemGroups.AETHER_TOOLS))),
item("skyroot_sword", new SwordItem(AetherItemTier.SKYROOT, 3, -2.4f, new Item.Properties().group(AetherItemGroups.AETHER_COMBAT))),
item("skyroot_shovel", new ShovelItem(AetherItemTier.SKYROOT, 1.5F, -3.0F, new Item.Properties().group(AetherItemGroups.AETHER_TOOLS))),
item("skyroot_pickaxe", new PickaxeItem(AetherItemTier.SKYROOT, 1, -2.8F, new Item.Properties().group(AetherItemGroups.AETHER_TOOLS))),
item("skyroot_axe", new AxeItem(AetherItemTier.SKYROOT, 6.0F, -3.2F, new Item.Properties().group(AetherItemGroups.AETHER_TOOLS))),
item("skyroot_sword", new SwordItem(AetherItemTier.SKYROOT, 3, -2.4F, new Item.Properties().group(AetherItemGroups.AETHER_COMBAT))),
item("holystone_shovel", new HolystoneShovelItem(AetherItemTier.HOLYSTONE, 1.5f, -3.0f, new Item.Properties().group(AetherItemGroups.AETHER_TOOLS))),
item("holystone_pickaxe", new HolystonePickaxeItem(AetherItemTier.HOLYSTONE, 1, -2.8f, new Item.Properties().group(AetherItemGroups.AETHER_TOOLS))),
item("holystone_axe", new HolystoneAxeItem(AetherItemTier.HOLYSTONE, 8.0f, -3.2f, new Item.Properties().group(AetherItemGroups.AETHER_TOOLS))),
item("holystone_sword", new HolystoneSwordItem(AetherItemTier.HOLYSTONE, 3, -2.4f, new Item.Properties().group(AetherItemGroups.AETHER_COMBAT))),
item("holystone_shovel", new HolystoneShovelItem(AetherItemTier.HOLYSTONE, 1.5F, -3.0F, new Item.Properties().group(AetherItemGroups.AETHER_TOOLS))),
item("holystone_pickaxe", new HolystonePickaxeItem(AetherItemTier.HOLYSTONE, 1, -2.8F, new Item.Properties().group(AetherItemGroups.AETHER_TOOLS))),
item("holystone_axe", new HolystoneAxeItem(AetherItemTier.HOLYSTONE, 8.0F, -3.2F, new Item.Properties().group(AetherItemGroups.AETHER_TOOLS))),
item("holystone_sword", new HolystoneSwordItem(AetherItemTier.HOLYSTONE, 3, -2.4F, new Item.Properties().group(AetherItemGroups.AETHER_COMBAT))),
item("zanite_shovel", new ZaniteShovelItem(AetherItemTier.ZANITE, 1.5f, -3.0f, new Item.Properties().group(AetherItemGroups.AETHER_TOOLS))),
item("zanite_pickaxe", new ZanitePickaxeItem(AetherItemTier.ZANITE, 1, -2.8f, new Item.Properties().group(AetherItemGroups.AETHER_TOOLS))),
item("zanite_axe", new ZaniteAxeItem(AetherItemTier.ZANITE, 8.0f, -3.1f, new Item.Properties().group(AetherItemGroups.AETHER_TOOLS))),
item("zanite_sword", new ZaniteSwordItem(AetherItemTier.ZANITE, 3, -2.4f, new Item.Properties().group(AetherItemGroups.AETHER_COMBAT))),
item("zanite_shovel", new ZaniteShovelItem(AetherItemTier.ZANITE, 1.5F, -3.0F, new Item.Properties().group(AetherItemGroups.AETHER_TOOLS))),
item("zanite_pickaxe", new ZanitePickaxeItem(AetherItemTier.ZANITE, 1, -2.8F, new Item.Properties().group(AetherItemGroups.AETHER_TOOLS))),
item("zanite_axe", new ZaniteAxeItem(AetherItemTier.ZANITE, 8.0F, -3.1F, new Item.Properties().group(AetherItemGroups.AETHER_TOOLS))),
item("zanite_sword", new ZaniteSwordItem(AetherItemTier.ZANITE, 3, -2.4F, new Item.Properties().group(AetherItemGroups.AETHER_COMBAT))),
item("gravitite_shovel", new GravititeShovelItem(AetherItemTier.GRAVITITE, 1.5f, -3.0f, new Item.Properties().group(AetherItemGroups.AETHER_TOOLS))),
item("gravitite_pickaxe", new GravititePickaxeItem(AetherItemTier.GRAVITITE, 1, -2.8f, new Item.Properties().group(AetherItemGroups.AETHER_TOOLS))),
item("gravitite_axe", new GravititeAxeItem(AetherItemTier.GRAVITITE, 5.0f, -3.0f, new Item.Properties().group(AetherItemGroups.AETHER_TOOLS))),
item("gravitite_sword", new GravititeSwordItem(AetherItemTier.GRAVITITE, 3, -2.4f, new Item.Properties().group(AetherItemGroups.AETHER_COMBAT))),
item("gravitite_shovel", new GravititeShovelItem(AetherItemTier.GRAVITITE, 1.5F, -3.0F, new Item.Properties().group(AetherItemGroups.AETHER_TOOLS))),
item("gravitite_pickaxe", new GravititePickaxeItem(AetherItemTier.GRAVITITE, 1, -2.8F, new Item.Properties().group(AetherItemGroups.AETHER_TOOLS))),
item("gravitite_axe", new GravititeAxeItem(AetherItemTier.GRAVITITE, 5.0F, -3.0F, new Item.Properties().group(AetherItemGroups.AETHER_TOOLS))),
item("gravitite_sword", new GravititeSwordItem(AetherItemTier.GRAVITITE, 3, -2.4F, new Item.Properties().group(AetherItemGroups.AETHER_COMBAT))),
item("valkyrie_shovel", new ShovelItem(AetherItemTier.VALKYRIE, 1.5f, -3.0f, new Item.Properties().rarity(Aether.AETHER_LOOT).group(AetherItemGroups.AETHER_TOOLS))),
item("valkyrie_pickaxe", new PickaxeItem(AetherItemTier.VALKYRIE, 1, -2.8f, new Item.Properties().rarity(Aether.AETHER_LOOT).group(AetherItemGroups.AETHER_TOOLS))),
item("valkyrie_axe", new AxeItem(AetherItemTier.VALKYRIE, 5.0f, -3.0f, new Item.Properties().rarity(Aether.AETHER_LOOT).group(AetherItemGroups.AETHER_TOOLS))),
item("valkyrie_shovel", new ShovelItem(AetherItemTier.VALKYRIE, 1.5F, -3.0F, new Item.Properties().rarity(Aether.AETHER_LOOT).group(AetherItemGroups.AETHER_TOOLS))),
item("valkyrie_pickaxe", new PickaxeItem(AetherItemTier.VALKYRIE, 1, -2.8F, new Item.Properties().rarity(Aether.AETHER_LOOT).group(AetherItemGroups.AETHER_TOOLS))),
item("valkyrie_axe", new AxeItem(AetherItemTier.VALKYRIE, 5.0F, -3.0F, new Item.Properties().rarity(Aether.AETHER_LOOT).group(AetherItemGroups.AETHER_TOOLS))),
item("zanite_helmet", new ArmorItem(AetherArmorMaterial.ZANITE, EquipmentSlotType.HEAD, new Item.Properties().group(AetherItemGroups.AETHER_COMBAT))),
item("zanite_chestplate", new ArmorItem(AetherArmorMaterial.ZANITE, EquipmentSlotType.CHEST, new Item.Properties().group(AetherItemGroups.AETHER_COMBAT))),
@@ -247,7 +247,7 @@ public class AetherItems {
.group(AetherItemGroups.AETHER_FOOD))),
item("healing_stone", new Item(new Item.Properties()
.food(new Food.Builder().setAlwaysEdible().hunger(0)
.effect(() -> new EffectInstance(Effects.INSTANT_HEALTH, 610, 0), 1.0f).build())
.effect(() -> new EffectInstance(Effects.INSTANT_HEALTH, 610, 0), 1.0F).build())
.group(AetherItemGroups.AETHER_FOOD))),
item("candy_cane", new Item(new Item.Properties()
.food(new Food.Builder().hunger(2).build())
@@ -287,14 +287,14 @@ public class AetherItems {
//item("phoenix_bow", new PhoenixBowItem(new Item.Properties().maxDamage(384).group(AetherItemGroups.AETHER_COMBAT))),
item("flaming_sword", new FlamingSwordItem(ItemTier.DIAMOND, 3, -2.4f, new Item.Properties().maxDamage(502).rarity(Aether.AETHER_LOOT).group(AetherItemGroups.AETHER_COMBAT))),
//item("lightning_sword", new LightningSwordItem(ItemTier.DIAMOND, 3, -2.4f, new Item.Properties().maxDamage(502).rarity(Aether.AETHER_LOOT).group(AetherItemGroups.AETHER_COMBAT))),
//item("holy_sword", new HolySwordItem(ItemTier.DIAMOND, 3, -2.4f, new Item.Properties().maxDamage(502).rarity(Aether.AETHER_LOOT).group(AetherItemGroups.AETHER_COMBAT))),
//item("vampire_blade", new VampireBladeItem(ItemTier.DIAMOND, 3, -2.4f, new Item.Properties().rarity(Aether.AETHER_LOOT).group(AetherItemGroups.AETHER_COMBAT))),
item("pig_slayer", new PigSlayerItem(ItemTier.IRON, 3, -2.4f, new Item.Properties().rarity(Aether.AETHER_LOOT).group(AetherItemGroups.AETHER_COMBAT))),
item("flaming_sword", new FlamingSwordItem(ItemTier.DIAMOND, 3, -2.4F, new Item.Properties().maxDamage(502).rarity(Aether.AETHER_LOOT).group(AetherItemGroups.AETHER_COMBAT))),
//item("lightning_sword", new LightningSwordItem(ItemTier.DIAMOND, 3, -2.4F, new Item.Properties().maxDamage(502).rarity(Aether.AETHER_LOOT).group(AetherItemGroups.AETHER_COMBAT))),
//item("holy_sword", new HolySwordItem(ItemTier.DIAMOND, 3, -2.4F, new Item.Properties().maxDamage(502).rarity(Aether.AETHER_LOOT).group(AetherItemGroups.AETHER_COMBAT))),
//item("vampire_blade", new VampireBladeItem(ItemTier.DIAMOND, 3, -2.4F, new Item.Properties().rarity(Aether.AETHER_LOOT).group(AetherItemGroups.AETHER_COMBAT))),
item("pig_slayer", new PigSlayerItem(ItemTier.IRON, 3, -2.4F, new Item.Properties().rarity(Aether.AETHER_LOOT).group(AetherItemGroups.AETHER_COMBAT))),
//item("candy_cane_sword", new CandyCaneSwordItem(ItemTier.GOLD, 3, -2.4F, new Item.Properties().group(AetherItemGroups.AETHER_COMBAT))),
//item("notch_hammer", new NotchHammerItem(new Item.Properties().group(AetherItemGroups.AETHER_COMBAT))),
//item("valkyrie_lance", new ValkyrieLanceItem(ItemTier.DIAMOND, 3, -2.4f, new Item.Properties().rarity(Aether.AETHER_LOOT).group(AetherItemGroups.AETHER_COMBAT))),
//item("valkyrie_lance", new ValkyrieLanceItem(ItemTier.DIAMOND, 3, -2.4F, new Item.Properties().rarity(Aether.AETHER_LOOT).group(AetherItemGroups.AETHER_COMBAT))),
//item("leather_gloves", new DyeableGlovesItem(ArmorMaterial.LEATHER, new Item.Properties().group(ItemGroup.COMBAT))),
//item("chainmail_gloves", new GlovesItem(ArmorMaterial.CHAIN, new Item.Properties().group(ItemGroup.COMBAT))),
@@ -354,19 +354,19 @@ public class AetherItems {
new Item.Properties().group(ItemGroup.MISC))),
item("zephyr_spawn_egg", new SpawnEggItem(
AetherEntityTypes.ZEPHYR,
/*primary color:*/ 0xdfdfdf, /*secondary color:*/ 0x99cfe8,
/*primary color:*/ 0xDFDFDF, /*secondary color:*/ 0x99CFE8,
new Item.Properties().group(ItemGroup.MISC))),
item("phyg_spawn_egg", new SpawnEggItem(
AetherEntityTypes.PHYG,
/*primary color:*/ 0xffc1d0, /*secondary color:*/ 0xffd939,
/*primary color:*/ 0xFFC1D0, /*secondary color:*/ 0xFFD939,
new Item.Properties().group(ItemGroup.MISC))),
item("flying_cow_spawn_egg", new SpawnEggItem(
AetherEntityTypes.FLYING_COW,
/*primary color:*/ 0xd8d8d8, /*secondary color:*/ 0xffd939,
/*primary color:*/ 0xD8D8D8, /*secondary color:*/ 0xFFD939,
new Item.Properties().group(ItemGroup.MISC))),
item("sheepuff_spawn_egg", new SpawnEggItem(
AetherEntityTypes.SHEEPUFF,
/*primary color:*/ 0xe2fcff, /*secondary color:*/ 0xcb9090,
/*primary color:*/ 0xE2FCFF, /*secondary color:*/ 0xCB9090,
new Item.Properties().group(ItemGroup.MISC))),
});
}


+ 1
- 1
src/main/java/com/aether/item/IGravititeToolItem.java View File

@@ -29,7 +29,7 @@ public interface IGravititeToolItem {
ItemStack heldItem = context.getItem();
if ((this.getDestroySpeed(heldItem, state) == this.getTier().getEfficiency() || ForgeHooks.isToolEffective(world, pos, heldItem)) && world.isAirBlock(pos.up())) {
if (world.getTileEntity(pos) != null || state.getBlockHardness(world, pos) == -1.0f) {
if (world.getTileEntity(pos) != null || state.getBlockHardness(world, pos) == -1.0F) {
return ActionResultType.FAIL;
}


+ 7
- 7
src/main/java/com/aether/item/IZaniteToolItem.java View File

@@ -5,28 +5,28 @@ import net.minecraft.item.ItemStack;
public interface IZaniteToolItem {

default float calculateIncrease(ItemStack tool, float original) {
if (original == 4.0f) {
if (original == 4.0F) {
int current = tool.getDamage();
int maxDamage = tool.getMaxDamage();
if (maxDamage - 50 <= current && current <= maxDamage) {
return 12.0f;
return 12.0F;
}
else if (maxDamage - 110 <= current && current <= maxDamage - 51) {
return 8.0f;
return 8.0F;
}
else if (maxDamage - 200 <= current && current <= maxDamage - 111) {
return 6.0f;
return 6.0F;
}
else if (maxDamage - 239 <= current && current <= maxDamage - 201) {
return 4.0f;
return 4.0F;
}
else {
return 2.0f;
return 2.0F;
}
}
else {
return 1.0f;
return 1.0F;
}
}


+ 2
- 2
src/main/java/com/aether/item/LightningKnifeItem.java View File

@@ -27,11 +27,11 @@ public class LightningKnifeItem extends Item {
heldItem.shrink(1);
}
worldIn.playSound(null, playerIn.getPosition(), AetherSoundEvents.ENTITY_PROJECTILE_SHOOT, SoundCategory.PLAYERS, 1.0f, 1.0f / (random.nextFloat() * 0.4f + 0.8f));
worldIn.playSound(null, playerIn.getPosition(), AetherSoundEvents.ENTITY_PROJECTILE_SHOOT, SoundCategory.PLAYERS, 1.0F, 1.0F / (random.nextFloat() * 0.4F + 0.8F));
if (!worldIn.isRemote) {
LightningKnifeEntity lightningKnife = new LightningKnifeEntity(playerIn, worldIn);
lightningKnife.shoot(playerIn, playerIn.rotationPitch, playerIn.rotationYaw, 0.0f, 0.5f, 1.0f);
lightningKnife.shoot(playerIn, playerIn.rotationPitch, playerIn.rotationYaw, 0.0F, 0.5F, 1.0F);
worldIn.addEntity(lightningKnife);
}


+ 3
- 3
src/main/java/com/aether/item/PigSlayerItem.java View File

@@ -29,7 +29,7 @@ public class PigSlayerItem extends SwordItem {
}

if (isEffectiveAgainst(target)) {
if (target.getHealth() > 0.0f) {
if (target.getHealth() > 0.0F) {
target.attackEntityFrom(DamageSource.causeMobDamage(attacker), 9999);
}

@@ -39,9 +39,9 @@ public class PigSlayerItem extends SwordItem {
double d2 = rand.nextGaussian() * 0.02;
double d3 = 5.0;
target.world.addParticle(ParticleTypes.FLAME,
target.getPosX() + (rand.nextFloat() * target.getWidth() * 2.0f) - target.getWidth() - d0 * d3,
target.getPosX() + (rand.nextFloat() * target.getWidth() * 2.0F) - target.getWidth() - d0 * d3,
target.getPosY() + (rand.nextFloat() * target.getHeight()) - d1 * d3,
target.getPosZ() + (rand.nextFloat() * target.getWidth() * 2.0f) - target.getWidth() - d2 * d3,
target.getPosZ() + (rand.nextFloat() * target.getWidth() * 2.0F) - target.getWidth() - d2 * d3,
d0, d1, d2);
}
}


+ 5
- 5
src/main/java/com/aether/item/ZaniteSwordItem.java View File

@@ -33,19 +33,19 @@ public class ZaniteSwordItem extends SwordItem {
int maxDamage = tool.getMaxDamage();
if (maxDamage - 50 <= current) {
return 7.0f;
return 7.0F;
}
else if (maxDamage - 110 <= current) {
return 6.0f;
return 6.0F;
}
else if (maxDamage - 200 <= current) {
return 5.0f;
return 5.0F;
}
else if (maxDamage - 239 <= current) {
return 4.0f;
return 4.0F;
}
else {
return 3.0f;
return 3.0F;
}
}



+ 9
- 9
src/main/java/com/aether/world/AetherTeleporter.java View File

@@ -86,7 +86,7 @@ public class AetherTeleporter implements ITeleporter {
}

double distance = blockpos1.distanceSq(pos);
if (d0 < 0.0D || distance < d0) {
if (d0 < 0.0 || distance < d0) {
d0 = distance;
blockpos = blockpos1;
}
@@ -293,10 +293,10 @@ public class AetherTeleporter implements ITeleporter {
player.setLocationAndAngles(d0, d1, d2, f1, f);
currentWorld.getProfiler().endSection();
currentWorld.getProfiler().startSection("placing");
double d7 = Math.min(-2.9999872E7D, destWorld.getWorldBorder().minX() + 16.0D);
double d4 = Math.min(-2.9999872E7D, destWorld.getWorldBorder().minZ() + 16.0D);
double d5 = Math.min(2.9999872E7D, destWorld.getWorldBorder().maxX() - 16.0D);
double d6 = Math.min(2.9999872E7D, destWorld.getWorldBorder().maxZ() - 16.0D);
double d7 = Math.min(-2.9999872E7, destWorld.getWorldBorder().minX() + 16.0);
double d4 = Math.min(-2.9999872E7, destWorld.getWorldBorder().minZ() + 16.0);
double d5 = Math.min(2.9999872E7, destWorld.getWorldBorder().maxX() - 16.0);
double d6 = Math.min(2.9999872E7, destWorld.getWorldBorder().maxZ() - 16.0);
d0 = MathHelper.clamp(d0, d7, d5);
d2 = MathHelper.clamp(d2, d4, d6);
player.setLocationAndAngles(d0, d1, d2, f1, f);
@@ -322,10 +322,10 @@ public class AetherTeleporter implements ITeleporter {
double d0 = entity.getPosX() * movementFactor;
double d1 = entity.getPosZ() * movementFactor;
double d3 = Math.min(-2.9999872E7D, destWorld.getWorldBorder().minX() + 16.0D);
double d4 = Math.min(-2.9999872E7D, destWorld.getWorldBorder().minZ() + 16.0D);
double d5 = Math.min(2.9999872E7D, destWorld.getWorldBorder().maxX() - 16.0D);
double d6 = Math.min(2.9999872E7D, destWorld.getWorldBorder().maxZ() - 16.0D);
double d3 = Math.min(-2.9999872E7, destWorld.getWorldBorder().minX() + 16.0);
double d4 = Math.min(-2.9999872E7, destWorld.getWorldBorder().minZ() + 16.0);
double d5 = Math.min(2.9999872E7, destWorld.getWorldBorder().maxX() - 16.0);
double d6 = Math.min(2.9999872E7, destWorld.getWorldBorder().maxZ() - 16.0);
d0 = MathHelper.clamp(d0, d3, d5);
d1 = MathHelper.clamp(d1, d4, d6);
Vec3d vec3d1 = entity.getLastPortalVec();


+ 4
- 4
src/main/java/com/aether/world/dimension/AetherDimension.java View File

@@ -39,7 +39,7 @@ public class AetherDimension extends Dimension {
@Override
@OnlyIn(Dist.CLIENT)
public float getCloudHeight() {
return 1F;
return 1.0F;
}

@Override
@@ -62,9 +62,9 @@ public class AetherDimension extends Dimension {
// TODO: implement the eternal day thing
@Override
public float calculateCelestialAngle(long worldTime, float partialTicks) {
double d0 = MathHelper.frac(worldTime / 24000.0D - 0.25D);
double d1 = 0.5D - Math.cos(d0 * Math.PI) / 2.0D;
return (float)(d0 * 2.0D + d1) / 3.0F;
double d0 = MathHelper.frac(worldTime / 24000.0 - 0.25);
double d1 = 0.5 - Math.cos(d0 * Math.PI) / 2.0;
return (float)(d0 * 2.0 + d1) / 3.0F;
}

@Override


+ 4
- 4
src/main/java/com/aether/world/gen/AetherChunkGenerator.java View File

@@ -14,17 +14,17 @@ public class AetherChunkGenerator extends NoiseChunkGenerator<AetherGenerationSe

@Override
protected void fillNoiseColumn(double[] noiseColumn, int noiseX, int noiseZ) {
this.calcNoiseColumn(noiseColumn, noiseX, noiseZ, 684.412F, 684.412F, 8.555149841308594D, 4.277574920654297D, 3, -10);
this.calcNoiseColumn(noiseColumn, noiseX, noiseZ, 684.412F, 684.412F, 8.555149841308594, 4.277574920654297, 3, -10);
}

@Override
protected double[] getBiomeNoiseColumn(int noiseX, int noiseZ) {
return new double[]{this.biomeProvider.func_222365_c(noiseX, noiseZ), 0.0D};
return new double[]{this.biomeProvider.func_222365_c(noiseX, noiseZ), 0.0};
}

@Override
protected double func_222545_a(double p_222545_1_, double p_222545_3_, int p_222545_5_) {
return 8.0D;
return 8.0;
}

@Override
@@ -34,7 +34,7 @@ public class AetherChunkGenerator extends NoiseChunkGenerator<AetherGenerationSe

@Override
protected double func_222553_h() {
return 8.0D;
return 8.0;
}

@Override


+ 369
- 0
unify_number_literals.py View File

@@ -0,0 +1,369 @@
KEEP = 0 # keep original capitalization
UPPER = 1 # convert to upper case
LOWER = 2 # convert to lower case
REMOVE = 3 # remove it
ADD = 4 # add it
TRUNC = 8 # for UNDERSCORES, if there is more than 1 underscore, remove the extras. for ZERO_XXXX, if there are unneccessary zeros, remove them.
ADD_IF_NEEDED = 16 # for DOUBLE_TYPE_SUFFIX, if REMOVE is also specified and ZERO_FPART is REMOVE, re-add the suffix and remove the trailing decimal point.
# ===== OPTIONS =====

HEX_PREFIX = LOWER
BINARY_PREFIX = LOWER
OCTAL_PREFIX = REMOVE

HEX_LITERAL = UPPER

ZERO_IPART = ADD | TRUNC
ZERO_FPART = ADD | TRUNC

IPART_UNDERSCORES = KEEP
FPART_UNDERSCORES = KEEP

DOUBLE_TYPE_SUFFIX = REMOVE
FLOAT_TYPE_SUFFIX = UPPER
LONG_TYPE_SUFFIX = UPPER

EXPONENT_INDICATOR = UPPER
HEX_EXPONENT_INDICATOR = LOWER

EXPONENT_SIGN = KEEP

#####################

assert HEX_PREFIX in (KEEP, UPPER, LOWER, REMOVE), f"Invalid value for HEX_PREFIX: {HEX_PREFIX}"
assert BINARY_PREFIX in (KEEP, UPPER, LOWER, REMOVE), f"Invalid value for BINARY_PREFIX: {BINARY_PREFIX}"
assert OCTAL_PREFIX in (KEEP, REMOVE), f"Invalid value for OCTAL_PREFIX: {OCTAL_PREFIX}"

assert HEX_LITERAL in (KEEP, UPPER, LOWER), f"Invalid value for HEX_LITERAL: {HEX_LITERAL}"

assert ZERO_IPART in (KEEP, ADD, REMOVE, TRUNC, ADD | TRUNC), f"Invalid value for ZERO_IPART: {ZERO_IPART}"
assert ZERO_FPART in (KEEP, ADD, REMOVE, TRUNC, ADD | TRUNC), f"Invalid value for ZERO_FPART: {ZERO_FPART}"

assert IPART_UNDERSCORES in (KEEP, ADD, REMOVE, TRUNC), f"Invalid value for IPART_UNDERSCORES: {IPART_UNDERSCORES}"
assert FPART_UNDERSCORES in (KEEP, ADD, REMOVE, TRUNC), f"Invalid value for FPART_UNDERSCORES: {FPART_UNDERSCORES}"

assert DOUBLE_TYPE_SUFFIX in (KEEP, ADD, REMOVE, UPPER, LOWER, REMOVE | ADD_IF_NEEDED) or DOUBLE_TYPE_SUFFIX.bit_length() == 3 and DOUBLE_TYPE_SUFFIX & (UPPER | LOWER) in (UPPER, LOWER), f"Invalid value for DOUBLE_TYPE_SUFFIX: {DOUBLE_TYPE_SUFFIX}"
assert FLOAT_TYPE_SUFFIX in (KEEP, UPPER, LOWER), f"Invalid value for FLOAT_TYPE_SUFFIX: {FLOAT_TYPE_SUFFIX}"
assert LONG_TYPE_SUFFIX in (KEEP, UPPER, LOWER), f"Invalid value for LONG_TYPE_SUFFIX: {LONG_TYPE_SUFFIX}"

assert EXPONENT_INDICATOR in (KEEP, UPPER, LOWER), f"Invalid value for EXPONENT_INDICATOR: {EXPONENT_INDICATOR}"
assert HEX_EXPONENT_INDICATOR in (KEEP, UPPER, LOWER), f"Invalid value for HEX_EXPONENT_INDICATOR: {HEX_EXPONENT_INDICATOR}"

assert EXPONENT_SIGN in (KEEP, ADD, REMOVE), f"Invalid value for EXPONENT_SIGN: {EXPONENT_SIGN}"

from glob import glob
import re
import os, os.path as path

os.chdir(path.dirname(path.abspath(__file__)))

DIGITS = r'(?:\d+(?:_+\d+)*)'
HEX_DIGITS = r'(?:[a-fA-F0-9]+(?:_+[a-fA-F0-9]+)*)'
BIN_DIGITS = r'(?:[01]+(?:_+[01]+)*)'
OCT_DIGITS = r'(?:[0-7]+(?:_+[0-7]+)*)'
ID_CHAR = r'[a-zA-Z_0-9$]'

# INT_REGEX = re.compile(r'(?<!{ID_CHAR})([1-9]\d*(?:_+\d+)*|0([xX]{HEX_DIGITS}|[bB][01]+(?:_+[01]+)*|_*[0-7]+(?:_+[0-7]+)*))(?!{ID_CHAR})'.format_map(globals()))
# LONG_REGEX = re.compile(r'(?<!{ID_CHAR})([1-9]\d*(?:_+\d+)*|0([xX]{HEX_DIGITS}|[bB][01]+(?:_+[01]+)*|_*[0-7]+(?:_+[0-7]+)*))[lL](?!{ID_CHAR})'.format_map(globals()))
# FLOAT_REGEX = re.compile(r'(?<!{ID_CHAR})((\.{DIGITS}|{DIGITS}(\.{DIGITS}?)?)([eE][-+]?{DIGITS})?|0[xX](\.{HEX_DIGITS}|{HEX_DIGITS}(\.{HEX_DIGITS}?)?)[pP][-+]?{DIGITS})[fF](?!{ID_CHAR})'.format_map(globals()))
# DOUBLE_REGEX = re.compile(r'(?<!{ID_CHAR})((\.{DIGITS}|{DIGITS}(\.{DIGITS}?|(?=[eEdD])))([eE][-+]?{DIGITS})?|0[xX](\.{HEX_DIGITS}|{HEX_DIGITS}(\.{HEX_DIGITS}?)?)[pP][-+]?{DIGITS})[dD]?(?!{ID_CHAR})'.format_map(globals()))

EXPONENT = r'(?:[eE][-+]?{DIGITS})'.format_map(globals())
HEX_EXPONENT = r'(?:[pP][-+]?{DIGITS})'.format_map(globals())

NUMBER_OR_STR_REGEX = re.compile(r'''(?x)
(["']) (\\ . | [^\\])*? \1
|
(?<!{ID_CHAR})
( \.{DIGITS}{EXPONENT}?[fFdD]?
| {DIGITS} ( \.{DIGITS}?{EXPONENT}?[fFdD]?
| {EXPONENT}[fFdD]?
| [lLfFdD]?
)
| 0[xX] ( \.{HEX_DIGITS}{HEX_EXPONENT}[fFdD]?
| {HEX_DIGITS} ( \.{HEX_DIGITS}?{HEX_EXPONENT}[fFdD]?
| {HEX_EXPONENT}[fFdD]?
| [lL]?
)
)
| 0[bB] {BIN_DIGITS}[lL]?
)
(?!{ID_CHAR})
'''.format_map(globals()))

HEX_REGEX = re.compile(r'(?P<prefix>0[xX])(?P<ipart>{HEX_DIGITS})?((?P<decimal>\.)(?P<fpart>{HEX_DIGITS})?)?((?P<xind>[pP])(?P<xpart>[-+]?{DIGITS}))?(?P<suffix>[lLfFdD]?)'.format_map(globals()))
DECIMAL_REGEX = re.compile(r'(?P<ipart>{DIGITS})?((?P<decimal>\.)(?P<fpart>{DIGITS})?)?((?P<xind>[eE])(?P<xpart>[-+]?{DIGITS}))?(?P<suffix>[lLfFdD]?)'.format_map(globals()))
OCTAL_REGEX = re.compile(r'(?P<prefix>0)(?P<ipart>{OCT_DIGITS})(?P<suffix>[lL]?)'.format_map(globals()))
BINARY_REGEX = re.compile(r'(?P<prefix>0[bB])(?P<ipart>{BIN_DIGITS})(?P<suffix>[lL]?)'.format_map(globals()))

UNDERSCORE_REGEX = re.compile(r'_+')
PREFIX_ZEROS = re.compile(r'^0+')
POSTFIX_ZEROS = re.compile(r'0+$')
ZEROS = re.compile(r'^0+$')

# HEX_PREFIX_REGEX = re.compile(r'0[xX]')
# P_REGEX = re.compile(r'[pP]')
# NON_OCTAL_CHAR_REGEX = re.compile(r'[89.eEpPxXbBfFdD]')
# BINARY_REGEX = re.compile(r'0[bB]')

# for num in '1.2', '3', '165_200', '14E-20', '1E10', '7e+2', '0x3A', '0x3AL', '0x3A.p4', '0x3A.Fp-2F', '0x3D_2AF.42P+20':
# assert NUMBER_REGEX.fullmatch(num), num

# def isfloat(s: str, /) -> bool:
# if HEX_REGEX.match(s) and not P_REGEX.search(s):
# return False
# return s[-1] in 'fF'

# def isdouble(s: str, /) -> bool:
# if HEX_REGEX.match(s) and not P_REGEX.search(s):
# return False
# if '.' in s:
# return s[-1] not in 'fF'
# return s[-1] in 'dD'

# def islong(s: str, /) -> bool:
# return s[-1] in 'lL'

# def isoctal(s: str, /) -> bool:
# return not NON_OCTAL_CHAR_REGEX.search(s)

replace_count = 0

def refactor(s: str) -> str:
if s[0] in ('"', "'"):
return s
global replace_count
if (m := HEX_REGEX.fullmatch(s)):
result = reformat(
prefix=m['prefix'],
ipart=m['ipart'],
decimal=m['decimal'],
fpart=m['fpart'],
xind=m['xind'],
xpart=m['xpart'],
suffix=m['suffix']
)
elif (m := OCTAL_REGEX.fullmatch(s)):
result = reformat(
prefix=m['prefix'],
ipart=m['ipart'],
suffix=m['suffix']
)
elif (m := BINARY_REGEX.fullmatch(s)):
result = reformat(
prefix=m['prefix'],
ipart=m['ipart'],
suffix=m['suffix']
)
elif (m := DECIMAL_REGEX.fullmatch(s)):
result = reformat(
ipart=m['ipart'],
decimal=m['decimal'],
fpart=m['fpart'],
xind=m['xind'],
xpart=m['xpart'],
suffix=m['suffix']
)
else:
assert False, f"Could not refactor {s!r}"
if result != s:
replace_count += 1
return result

LEFT = -1
RIGHT = 1

def create_fix_underscores(underscores: int, direction: LEFT|RIGHT=0):
if underscores == ADD:
if direction == LEFT:
def fix_underscores(s: str) -> str:
if not s: return ""
for i in range(len(s) - 4, 0, -4):
s = s[0:i] + '_' + s[i+1:]
return s
elif direction == RIGHT:
def fix_underscores(s: str) -> str:
if not s: return ""
for i in range(3, len(s), 4):
s = s[0:i] + '_' + s[i+1:]
return s
else:
assert False, f"Invalid value for direction: {direction}"
else:
if underscores == KEEP:
underscore_replacement = R"\0"
elif underscores == REMOVE:
underscore_replacement = ""
elif underscores == TRUNC:
underscore_replacement = "_"
else:
assert False, f"Invalid value for UNDERSCORES: {underscores}"
def fix_underscores(s: str) -> str:
if not s: return ""
return UNDERSCORE_REGEX.sub(underscore_replacement, s)
return fix_underscores

fix_ipart_underscores = create_fix_underscores(IPART_UNDERSCORES, direction=LEFT)
fix_fpart_underscores = create_fix_underscores(FPART_UNDERSCORES, direction=RIGHT)

def reformat(*, prefix: str="", ipart: str="", decimal: str="", fpart: str="", xind: str="", xpart: str="", suffix: str="") -> str:
prefix = prefix or ""
ipart = fix_ipart_underscores(ipart)
decimal = decimal or ""
fpart = fix_fpart_underscores(fpart)
xind = xind or ""
xpart = xpart or ""
suffix = suffix or ""

assert ipart or fpart, "both ipart and xpart were empty"
if fpart: assert decimal, "decimal was empty when fpart was not empty"

if xind: assert xpart, "xpart was empty when xind was not empty"