diff --git a/build.gradle b/build.gradle index 8c95188de..71f6545c7 100644 --- a/build.gradle +++ b/build.gradle @@ -40,7 +40,7 @@ minecraft { version = minecraft_version + "-" + forge_version runDir = "run" - replace "@ALLOWED_VERSIONS@", "[5.9.0, 5.10)" + replace "@ALLOWED_VERSIONS@", "[5.10.0, 5.11)" replace "@VERSION@", project.version replaceIn "FlansMod.java" replaceIn "ModernWeaponsPackMod.java" @@ -53,7 +53,7 @@ minecraft { replaceIn "YeOldePackMod.java" replaceIn "ZombiePackMod.java" - replace "@ALLOWED_VERSIONS_APOCALYPSE@", "[1.3, 1.4)" + replace "@ALLOWED_VERSIONS_APOCALYPSE@", "[1.4, 1.5)" replace "@VERSION_APOCALYPSE@", project.apocalypseVersion replaceIn "FlansModApocalypse.java" diff --git a/gradle.properties b/gradle.properties index fd122f63d..3a716e5d0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ minecraft_version = 1.12.2 jei_version = 4.15.0.293 version_major = 5 -version_minor = 9 +version_minor = 10 version_patch = 0 version_extra = -apocalypseVersion = 1.3.3 +apocalypseVersion = 1.4.0 diff --git a/run/Flan/Apocalypse Pack/assets/flansmod/lang/en_us.lang b/run/Flan/Apocalypse Pack/assets/flansmod/lang/en_us.lang index a43394019..eedc95790 100644 --- a/run/Flan/Apocalypse Pack/assets/flansmod/lang/en_us.lang +++ b/run/Flan/Apocalypse Pack/assets/flansmod/lang/en_us.lang @@ -4,4 +4,5 @@ item.aiChip.name=AI Chip item.complicatedCircuit.name=Complicated Circuit item.nuclearPowerCore.name=Nuclear Power Core tile.flanGunRack.name=Gun Rack -item.buggy.name=Buggy \ No newline at end of file +item.buggy.name=Buggy +item.nukranium_gauntlet.name=Nukranium Gauntlet \ No newline at end of file diff --git a/run/Flan/Apocalypse Pack/assets/flansmod/models/item/nukranium_gauntlet.json b/run/Flan/Apocalypse Pack/assets/flansmod/models/item/nukranium_gauntlet.json new file mode 100644 index 000000000..333aaf468 --- /dev/null +++ b/run/Flan/Apocalypse Pack/assets/flansmod/models/item/nukranium_gauntlet.json @@ -0,0 +1,107 @@ +{ + "credit": "Made with Blockbench", + "textures": { + "0": "flansmod:items/nukranium_gauntlet", + "particle": "flansmod:items/nukranium_gauntlet" + }, + "elements": [ + { + "from": [5, 5, 5], + "to": [11, 11, 11], + "faces": { + "north": {"uv": [0, 0, 6, 6], "texture": "#0"}, + "east": {"uv": [0, 0, 6, 6], "texture": "#0"}, + "south": {"uv": [0, 0, 6, 6], "texture": "#0"}, + "west": {"uv": [0, 0, 6, 6], "texture": "#0"}, + "up": {"uv": [0, 0, 6, 6], "texture": "#0"}, + "down": {"uv": [0, 0, 6, 6], "texture": "#0"} + } + }, + { + "from": [6, 6, 4], + "to": [10, 10, 5], + "rotation": {"angle": 0, "axis": "z", "origin": [8, 8, 4]}, + "faces": { + "north": {"uv": [0, 8, 4, 12], "texture": "#0"}, + "east": {"uv": [4, 8, 5, 12], "texture": "#0"}, + "south": {"uv": [0, 12, 4, 16], "texture": "#0"}, + "west": {"uv": [4, 12, 5, 16], "texture": "#0"}, + "up": {"uv": [0, 6, 4, 7], "texture": "#0"}, + "down": {"uv": [0, 7, 4, 8], "texture": "#0"} + } + }, + { + "from": [5.5, 5.5, 9], + "to": [10.5, 10.5, 13], + "faces": { + "north": {"uv": [0, 0, 5, 5], "texture": "#0"}, + "east": {"uv": [0, 0, 4, 5], "texture": "#0"}, + "south": {"uv": [0, 0, 5, 5], "texture": "#0"}, + "west": {"uv": [0, 0, 4, 5], "texture": "#0"}, + "up": {"uv": [0, 0, 5, 4], "texture": "#0"}, + "down": {"uv": [0, 0, 5, 4], "texture": "#0"} + } + }, + { + "name": "spike", + "from": [9.25, 9.75, 6], + "to": [10.25, 10.75, 10], + "rotation": {"angle": -22.5, "axis": "x", "origin": [9, 10, 6]}, + "faces": { + "north": {"uv": [10, 0, 11, 1], "texture": "#0"}, + "east": {"uv": [12, 1, 16, 2], "texture": "#0"}, + "south": {"uv": [11, 1, 12, 2], "texture": "#0"}, + "west": {"uv": [12, 0, 16, 1], "texture": "#0"}, + "up": {"uv": [10, 0, 11, 4], "texture": "#0"}, + "down": {"uv": [9, 0, 10, 4], "texture": "#0"} + } + }, + { + "name": "spike", + "from": [5.75, 9.5, 6], + "to": [6.75, 10.5, 10], + "rotation": {"angle": -22.5, "axis": "x", "origin": [6, 10, 6]}, + "faces": { + "north": {"uv": [10, 0, 11, 1], "texture": "#0"}, + "east": {"uv": [12, 1, 16, 2], "texture": "#0"}, + "south": {"uv": [11, 1, 12, 2], "texture": "#0"}, + "west": {"uv": [12, 0, 16, 1], "texture": "#0"}, + "up": {"uv": [10, 0, 11, 4], "texture": "#0"}, + "down": {"uv": [9, 0, 10, 4], "texture": "#0"} + } + }, + { + "name": "spike", + "from": [7.5, 9.625, 6], + "to": [8.5, 10.625, 10], + "rotation": {"angle": -22.5, "axis": "x", "origin": [8, 10, 6]}, + "faces": { + "north": {"uv": [10, 0, 11, 1], "texture": "#0"}, + "east": {"uv": [12, 1, 16, 2], "texture": "#0"}, + "south": {"uv": [11, 1, 12, 2], "texture": "#0"}, + "west": {"uv": [12, 0, 16, 1], "texture": "#0"}, + "up": {"uv": [10, 0, 11, 4], "texture": "#0"}, + "down": {"uv": [9, 0, 10, 4], "texture": "#0"} + } + } + ], + "display": { + "thirdperson_righthand": { + "translation": [0, -2, 0], + "scale": [1, 1, 1] + }, + "thirdperson_lefthand": { + "translation": [0, -2, 0] + }, + "firstperson_righthand": { + "scale": [1, 1, 1] + }, + "gui": { + "rotation": [45, 135, 0], + "scale": [1.2, 1.2, 1.2] + }, + "fixed": { + "rotation": [-90, 0, 0] + } + } +} \ No newline at end of file diff --git a/run/Flan/Apocalypse Pack/assets/flansmod/textures/items/nukranium_gauntlet.png b/run/Flan/Apocalypse Pack/assets/flansmod/textures/items/nukranium_gauntlet.png new file mode 100644 index 000000000..f73b00bb4 Binary files /dev/null and b/run/Flan/Apocalypse Pack/assets/flansmod/textures/items/nukranium_gauntlet.png differ diff --git a/run/Flan/Apocalypse Pack/gloves/NukraniumGauntlet.txt b/run/Flan/Apocalypse Pack/gloves/NukraniumGauntlet.txt new file mode 100644 index 000000000..10b790e08 --- /dev/null +++ b/run/Flan/Apocalypse Pack/gloves/NukraniumGauntlet.txt @@ -0,0 +1,7 @@ +Name Nukranium Gauntlet +ShortName nukranium_gauntlet +Icon nukranium_gauntlet +//Colour in Red, Green, Blue, each going up to 255. +Colour 255 255 255 +Enchantability 50 +Durability 2048 \ No newline at end of file diff --git a/src/main/java/com/flansmod/apocalypse/common/FlansModApocalypse.java b/src/main/java/com/flansmod/apocalypse/common/FlansModApocalypse.java index 1d2f5e4d0..9462f45e3 100644 --- a/src/main/java/com/flansmod/apocalypse/common/FlansModApocalypse.java +++ b/src/main/java/com/flansmod/apocalypse/common/FlansModApocalypse.java @@ -61,6 +61,8 @@ import com.flansmod.common.FlansMod; import com.flansmod.common.IFlansModContentProvider; import com.flansmod.common.ItemHolderType; +import com.flansmod.common.enchantments.GloveType; +import com.flansmod.common.enchantments.ItemGlove; import com.flansmod.common.parts.PartType; @Mod(modid = FlansModApocalypse.MODID, name = "Flan's Mod: Apocalypse", version = FlansModApocalypse.VERSION, acceptableRemoteVersions = "@ALLOWED_VERSIONS_APOCALYPSE@", dependencies = "required-after:" + FlansMod.MODID) @@ -91,6 +93,7 @@ public class FlansModApocalypse implements IFlansModContentProvider public static int AIRPORT_RARITY = 125; public static int DYE_FACTORY_RARITY = 400; public static int LAB_RARITY = 100; + // TODO: Configify public static int ABANDONED_PORTAL_APOC_RARITY = 4000; @@ -104,6 +107,7 @@ public class FlansModApocalypse implements IFlansModContentProvider * How far from their death point does the player respawn? */ public static int SPAWN_RADIUS = 100; + public static boolean RESPAWN_IN_APOC = false; /** * Who gets teleported to the apocalypse when a player places a mecha? */ @@ -130,6 +134,8 @@ public class FlansModApocalypse implements IFlansModContentProvider //References to apocalypse specific items and blocks: public static BlockItemHolder skeleton, slumpedSkeleton, gunRack; + public static ItemGlove nukraniumGauntlet; + static { FluidRegistry.enableUniversalBucket(); @@ -274,6 +280,11 @@ public void init(FMLInitializationEvent event) if(PartType.getPart("nuclearPowerCore") != null) PartType.getPart("nuclearPowerCore").item.setCreativeTab(tabApocalypse); + if(GloveType.getGlove("nukranium_gauntlet") != null) + { + nukraniumGauntlet = (ItemGlove)GloveType.getGlove("nukranium_gauntlet").item; + } + lootGenerator = new FlansModLootGenerator(); } @@ -343,6 +354,7 @@ public static void syncConfig() ABANDONED_PORTAL_APOC_RARITY = configFile.getInt("Abandoned Portal Rarity (Apocalypse)", Configuration.CATEGORY_GENERAL, ABANDONED_PORTAL_APOC_RARITY, 1, Integer.MAX_VALUE, "Rarity of the abandoned portal structures in the apocalypse"); ABANDONED_PORTAL_OVERWORLD_RARITY = configFile.getInt("Abandoned Portal Rarity (Other Dimensions)", Configuration.CATEGORY_GENERAL, ABANDONED_PORTAL_OVERWORLD_RARITY, 1, Integer.MAX_VALUE, "Rarity of the abandoned portal structures in other dimensions"); + RESPAWN_IN_APOC = configFile.getBoolean("Respawn in Apocalypse", Configuration.CATEGORY_GENERAL, RESPAWN_IN_APOC, "If false, players will return to their overworld spawn point"); if(configFile.hasChanged()) configFile.save(); diff --git a/src/main/java/com/flansmod/apocalypse/common/entity/EntitySkullBoss.java b/src/main/java/com/flansmod/apocalypse/common/entity/EntitySkullBoss.java index 8d1d75ef4..626f17d3f 100644 --- a/src/main/java/com/flansmod/apocalypse/common/entity/EntitySkullBoss.java +++ b/src/main/java/com/flansmod/apocalypse/common/entity/EntitySkullBoss.java @@ -7,6 +7,7 @@ import com.flansmod.common.guns.ItemGun; import com.flansmod.common.network.PacketPlaySound; +import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.MoverType; @@ -390,6 +391,17 @@ public void setDead() dropItem(FlansMod.gunpowderBlockItem, rand.nextInt(4) + 1); dropItem(FlansMod.gunpowderBlockItem, rand.nextInt(4) + 1); dropItem(FlansMod.gunpowderBlockItem, rand.nextInt(4) + 1); + + if(FlansModApocalypse.nukraniumGauntlet != null) + { + ItemStack gauntlet = new ItemStack(FlansModApocalypse.nukraniumGauntlet); + // 50% enchanted, 50% clean + if(rand.nextBoolean()) + { + EnchantmentHelper.addRandomEnchantment(world.rand, gauntlet, 50, true); + } + entityDropItem(gauntlet, 0.0f); + } } } } diff --git a/src/main/java/com/flansmod/apocalypse/common/entity/EntityTeleporter.java b/src/main/java/com/flansmod/apocalypse/common/entity/EntityTeleporter.java index 6eef3232b..0ab66bb9c 100644 --- a/src/main/java/com/flansmod/apocalypse/common/entity/EntityTeleporter.java +++ b/src/main/java/com/flansmod/apocalypse/common/entity/EntityTeleporter.java @@ -136,11 +136,14 @@ private void findPortal(EntityPlayer player) { if(overworld.isAirBlock(pos) && overworld.isSideSolid(pos.down(), EnumFacing.UP)) { - //We have found a valid position - if(createPortal(overworld, pos)) + if(overworld.getWorldBorder().contains(pos) && overworld.getWorldBorder().contains(pos.add(3, 0, 3))) { - targetTeleporter = pos; - return; + //We have found a valid position + if(createPortal(overworld, pos)) + { + targetTeleporter = pos; + return; + } } } } @@ -160,11 +163,14 @@ private void findPortal(EntityPlayer player) { if(apocWorld.isAirBlock(pos) && apocWorld.isSideSolid(pos.down(), EnumFacing.UP)) { - //We have found a valid position - if(createPortal(apocWorld, pos)) + if(apocWorld.getWorldBorder().contains(pos) && apocWorld.getWorldBorder().contains(pos.add(3, 0, 3))) { - targetTeleporter = pos; - return; + //We have found a valid position + if(createPortal(apocWorld, pos)) + { + targetTeleporter = pos; + return; + } } } } diff --git a/src/main/java/com/flansmod/apocalypse/common/world/WorldProviderApocalypse.java b/src/main/java/com/flansmod/apocalypse/common/world/WorldProviderApocalypse.java index cece06fcd..c8ece6b03 100644 --- a/src/main/java/com/flansmod/apocalypse/common/world/WorldProviderApocalypse.java +++ b/src/main/java/com/flansmod/apocalypse/common/world/WorldProviderApocalypse.java @@ -32,7 +32,7 @@ public IChunkGenerator createChunkGenerator() @Override public boolean canRespawnHere() { - return true; + return FlansModApocalypse.RESPAWN_IN_APOC; } @Override diff --git a/src/main/java/com/flansmod/common/driveables/EntityPlane.java b/src/main/java/com/flansmod/common/driveables/EntityPlane.java index d8eaedd29..fd793d3fb 100644 --- a/src/main/java/com/flansmod/common/driveables/EntityPlane.java +++ b/src/main/java/com/flansmod/common/driveables/EntityPlane.java @@ -638,6 +638,12 @@ world.isRemote && getSeat(0) != null && getSeat(0).getControllingPassenger() ins float targetWheelLength = targetWheelPos.length(); float currentWheelLength = currentWheelPos.length(); + if(currentWheelLength > targetWheelLength * 3.0d) + { + // Make wheels break? + //this.attackPart(EnumDriveablePart.backLeftWheel, source, damage); + } + float dLength = targetWheelLength - currentWheelLength; float dAngle = Vector3f.angle(targetWheelPos, currentWheelPos); @@ -681,11 +687,11 @@ world.isRemote && getSeat(0) != null && getSeat(0).getControllingPassenger() ins amountToMoveCar.y += ((wheel.posY - wheel.prevPosY) - (motionY)) * 0.5F / wheels.length; //amountToMoveCar.z += ((wheel.posZ - wheel.prevPosZ) - (motionZ)) * 0.0616F / wheels.length; - if(amountToMoveWheel.lengthSquared() >= 16f * 16f) + if(amountToMoveWheel.lengthSquared() >= 32f * 32f) { - FlansMod.log.warn("Wheel tried to move " + amountToMoveWheel.length() + " in a single frame, capping at 16 blocks"); + FlansMod.log.warn("Wheel tried to move " + amountToMoveWheel.length() + " in a single frame, capping at 32 blocks"); amountToMoveWheel.normalise(); - amountToMoveWheel.scale(16f); + amountToMoveWheel.scale(32f); } wheel.move(MoverType.SELF, amountToMoveWheel.x, amountToMoveWheel.y, amountToMoveWheel.z); diff --git a/src/main/java/com/flansmod/common/driveables/EntitySeat.java b/src/main/java/com/flansmod/common/driveables/EntitySeat.java index 6546401ed..a7b952ea5 100644 --- a/src/main/java/com/flansmod/common/driveables/EntitySeat.java +++ b/src/main/java/com/flansmod/common/driveables/EntitySeat.java @@ -456,14 +456,31 @@ public void updatePosition() .toVec3().subtract(0, entityInThisSeat.getEyeHeight(), 0); // driveable.rotate(0, riddenByEntity.getYOffset(), 0).toVec3(); - playerPosX = posX + yOffset.x; - playerPosY = posY + yOffset.y; - playerPosZ = posZ + yOffset.z; + double x = posX + yOffset.x; + double y = posY + yOffset.y; + double z = posZ + yOffset.z; - entityInThisSeat.lastTickPosX = getControllingPassenger().prevPosX = prevPlayerPosX; - entityInThisSeat.lastTickPosY = getControllingPassenger().prevPosY = prevPlayerPosY; - entityInThisSeat.lastTickPosZ = getControllingPassenger().prevPosZ = prevPlayerPosZ; - entityInThisSeat.setPosition(playerPosX, playerPosY, playerPosZ); + if((Math.abs(prevPlayerPosX - x) > 100d + || Math.abs(prevPlayerPosY - y) > 100d + || Math.abs(prevPlayerPosZ - z) > 100d) + && prevPlayerPosY > 0.00001d) + { + + FlansMod.log.warn("Player was made to move stupid distance in a frame, cancelling"); + //entityInThisSeat.dismountRidingEntity(); + } + else + { + // Set the absol + entityInThisSeat.setPosition(playerPosX, playerPosY, playerPosZ); + playerPosX = x; + playerPosY = y; + playerPosZ = z; + + entityInThisSeat.lastTickPosX = getControllingPassenger().prevPosX = prevPlayerPosX; + entityInThisSeat.lastTickPosY = getControllingPassenger().prevPosY = prevPlayerPosY; + entityInThisSeat.lastTickPosZ = getControllingPassenger().prevPosZ = prevPlayerPosZ; + } // Calculate the local look axes globally RotatedAxes globalLookAxes = driveable.axes.findLocalAxesGlobally(playerLooking); @@ -772,6 +789,9 @@ public boolean processInitialInteract(EntityPlayer entityplayer, { looking.setAngles(-animal.rotationYaw, animal.rotationPitch, 0F); animal.clearLeashed(true, !entityplayer.capabilities.isCreativeMode); + playerPosX = prevPlayerPosX = animal.posX; + playerPosY = prevPlayerPosY = animal.posY; + playerPosZ = prevPlayerPosZ = animal.posZ; } else { @@ -784,7 +804,13 @@ public boolean processInitialInteract(EntityPlayer entityplayer, // Put them in the seat if(getControllingPassenger() == null && !driveable.getDriveableData().engine.isAIChip) { - if(!entityplayer.startRiding(this)) + if(entityplayer.startRiding(this)) + { + playerPosX = prevPlayerPosX = entityplayer.posX; + playerPosY = prevPlayerPosY = entityplayer.posY; + playerPosZ = prevPlayerPosZ = entityplayer.posZ; + } + else { FlansMod.log.warn("Failed to mount seat"); } @@ -841,6 +867,10 @@ public boolean startRiding(Entity riding) EntityDriveable driveable = (EntityDriveable)riding; driveable.registerSeat(this); } + + playerPosX = prevPlayerPosX = riding.posX; + playerPosY = prevPlayerPosY = riding.posY; + playerPosZ = prevPlayerPosZ = riding.posZ; return success; } diff --git a/src/main/java/com/flansmod/common/enchantments/GloveType.java b/src/main/java/com/flansmod/common/enchantments/GloveType.java index 1fa56a71d..7e2fb58d2 100644 --- a/src/main/java/com/flansmod/common/enchantments/GloveType.java +++ b/src/main/java/com/flansmod/common/enchantments/GloveType.java @@ -8,6 +8,7 @@ import com.flansmod.common.driveables.DriveablePosition; import com.flansmod.common.driveables.DriveableType; import com.flansmod.common.driveables.Seat; +import com.flansmod.common.parts.PartType; import com.flansmod.common.types.InfoType; import com.flansmod.common.types.TypeFile; import com.flansmod.common.types.InfoType.ParseFunc; @@ -16,7 +17,7 @@ public class GloveType extends InfoType { - public static ArrayList types = new ArrayList<>(); + public static ArrayList gloves = new ArrayList<>(); private static HashMap> parsers = new HashMap<>(); static { @@ -37,7 +38,7 @@ public GloveType(TypeFile file) public void preRead(TypeFile file) { super.preRead(file); - types.add(this); + gloves.add(this); } @Override @@ -67,4 +68,14 @@ public void postRead(TypeFile file) { super.postRead(file); } + + public static GloveType getGlove(String s) + { + for(GloveType glove : gloves) + { + if(glove.shortName.equals(s)) + return glove; + } + return null; + } }