Skip to content

Commit

Permalink
final edits
Browse files Browse the repository at this point in the history
  • Loading branch information
ANightDazingZoroark committed Jan 10, 2024
1 parent e296677 commit c5916ab
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class ApatosaurusConfig extends RiftConfig {
public static String apatosaurusSaddleItem = "prift:apatosaurus_platform:0";
public static boolean apatosaurusPassengerWhitelist = false;
public static String[] apatosaurusPassengerBlacklist = {"minecraft:ender_dragon", "minecraft:wither", "prift:tyrannosaurus", "prift:apatosaurus"};
public static boolean apatosaurusCanBreakBlocks = true;
// public static boolean apatosaurusCanBreakBlocks = true;

public ApatosaurusConfig(Configuration config) {
super(config, new String[]{"tag:plains:7:1:3", "-tag:savanna"});
Expand All @@ -31,7 +31,7 @@ public void init() {
apatosaurusSaddleItem = config.getString("Apatosaurus Saddle Item", "General", "prift:apatosaurus_platform:0", "Item that counts as a saddle for this creature. To add an item add \"<insert item's identifier here>:<insert data id here>\"");
apatosaurusPassengerWhitelist = config.getBoolean("Use Apatosaurus passenger blacklist as a whitelist", "General", false, "Turn the blacklist of mobs that can be made to forcefully ride an Apatosaurus (with a platform) into a whitelist");
apatosaurusPassengerBlacklist = config.getStringList("Mobs that not can be passengers for the Apatosaurus", "General", new String[]{"minecraft:ender_dragon", "minecraft:wither", "prift:tyrannosaurus", "prift:apatosaurus"}, "Mobs within this list cannot be passengers on the back of an Apatosaurus (with a platform)");
apatosaurusCanBreakBlocks = config.getBoolean("Apatosaurus can break blocks", "General", true, "If true, this mob can break blocks weaker than wood just by walking through them.");
// apatosaurusCanBreakBlocks = config.getBoolean("Apatosaurus can break blocks", "General", true, "If true, this mob can break blocks weaker than wood just by walking through them.");
}

public static double getMaxHealth() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class TyrannosaurusConfig extends RiftConfig {
public static String[] tyrannosaurusBreedingFood = {"prift:basic_carnivore_meal:0:0", "prift:advanced_carnivore_meal:0:0"};
public static String[] tyrannosaurusTargets = {"minecraft:player", "minecraft:pig", "minecraft:chicken", "minecraft:cow", "minecraft:sheep", "minecraft:ocelot", "minecraft:wolf", "minecraft:rabbit", "minecraft:horse", "minecraft:donkey", "minecraft:mule", "minecraft:llama", "minecraft:villager", "prift:stegosaurus", "prift:dodo", "prift:triceratops", "prift:apatosaurus"};
public static boolean tyrannosaurusRoarTargetsWhitelist = false;
public static String[] tyrannosaurusRoarTargetBlacklist = {"prift:tyrannosaurus"};
public static String[] tyrannosaurusRoarTargetBlacklist = {"prift:tyrannosaurus", "prift:apatosaurus"};
public static String tyrannosaurusSaddleItem = "minecraft:saddle:0";

public TyrannosaurusConfig(Configuration config) {
Expand All @@ -30,7 +30,7 @@ public void init() {
tyrannosaurusBreedingFood = config.getStringList("Tyrannosaurus Breeding Food", "General", new String[]{"prift:basic_carnivore_meal:0:0", "prift:advanced_carnivore_meal:0:0"}, "List of foods Tyrannosauruses need to be fed in order to breed. To add items add \"<insert item's identifier here>:<insert data id here>:0\"");
tyrannosaurusTargets = config.getStringList("Tyrannosaurus Targets", "General", new String[]{"minecraft:player", "minecraft:pig", "minecraft:chicken", "minecraft:cow", "minecraft:sheep", "minecraft:ocelot", "minecraft:wolf", "minecraft:rabbit", "minecraft:horse", "minecraft:donkey", "minecraft:mule", "minecraft:llama", "minecraft:villager", "prift:stegosaurus", "prift:dodo", "prift:triceratops", "prift:apatosaurus"}, "Identifiers of mobs that the Tyrannosaurus will actively hunt");
tyrannosaurusRoarTargetsWhitelist = config.getBoolean("Use Tyrannosaurus roar blacklist as a whitelist", "General", false, "Turn the blacklist of mobs affected by the Tyrannosaurus' roar into a whitelist of affected mobs");
tyrannosaurusRoarTargetBlacklist = config.getStringList("Mobs unaffected by Tyrannosaurus roar", "General", new String[]{"prift:tyrannosaurus"}, "Mobs within this list are immune to this mobs knockback roar");
tyrannosaurusRoarTargetBlacklist = config.getStringList("Mobs unaffected by Tyrannosaurus roar", "General", new String[]{"prift:tyrannosaurus", "prift:apatosaurus"}, "Mobs within this list are immune to this mobs knockback roar");
tyrannosaurusSaddleItem = config.getString("Tyrannosaurus Saddle Item", "General", "minecraft:saddle:0", "Item that counts as a saddle for this creature. To add an item add \"<insert item's identifier here>:<insert data id here>\"");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,31 +118,32 @@ public void onLivingUpdate() {
super.onLivingUpdate();
this.manageWeaponCooldown();
if (!this.world.isRemote) this.manageCatapultAnims();
this.manageLoaded();
this.manageBreakBlock();
//passenger stuff
if (this.getPassengers().size() == 1) this.dismount = false;
}

private void manageBreakBlock() {
if (ApatosaurusConfig.apatosaurusCanBreakBlocks && net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.world, this)) {
for (int x = (int)this.getEntityBoundingBox().minX - 2; x <= (int)this.getEntityBoundingBox().maxX + 2; x++) {
for (int y = (int)this.getEntityBoundingBox().minY; y <= (int)this.getEntityBoundingBox().maxY + 4 && y <= 256; y++) {
for (int z = (int)this.getEntityBoundingBox().minZ - 2; z <= (int)this.getEntityBoundingBox().maxZ + 2; z++) {
IBlockState state = world.getBlockState(new BlockPos(x, y, z));
Block block = state.getBlock();
if (RiftUtil.blockWeakerThanWood(block, state)) {
this.motionX *= 0.6D;
this.motionZ *= 0.6D;
if (!this.world.isRemote) {
this.world.destroyBlock(new BlockPos(x, y, z), false);
}
}
}
}
}
}
}
//this will be repurposed in the next update so that most mobs will break blocks
//using their forced attack, or can clear up paths when in search of a target
//utilizin their attacks
// private void manageBreakBlock() {
// if (ApatosaurusConfig.apatosaurusCanBreakBlocks && net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.world, this)) {
// for (int x = (int)this.getEntityBoundingBox().minX - 2; x <= (int)this.getEntityBoundingBox().maxX + 2; x++) {
// for (int y = (int)this.getEntityBoundingBox().minY; y <= (int)this.getEntityBoundingBox().maxY + 4 && y <= 256; y++) {
// for (int z = (int)this.getEntityBoundingBox().minZ - 2; z <= (int)this.getEntityBoundingBox().maxZ + 2; z++) {
// IBlockState state = world.getBlockState(new BlockPos(x, y, z));
// Block block = state.getBlock();
// if (RiftUtil.blockWeakerThanWood(block, state)) {
// this.motionX *= 0.6D;
// this.motionZ *= 0.6D;
// if (!this.world.isRemote) {
// this.world.destroyBlock(new BlockPos(x, y, z), false);
// }
// }
// }
// }
// }
// }
// }

private void manageWeaponCooldown() {
if (this.getLeftClickCooldown() > 0) this.setLeftClickCooldown(this.getLeftClickCooldown() - 1);
Expand Down Expand Up @@ -227,10 +228,12 @@ else if (!settings.keyBindAttack.isKeyDown() && !settings.keyBindUseItem.isKeyDo
}
}

private void manageLoaded() {
//i have no fucking idea why but this breaks the apato's ability to use catapults
//just wtf
public void manageLoaded() {
if (this.getWeapon().equals(RiftLargeWeaponType.CATAPULT)) {
boolean flag1 = false;
boolean flag2 = this.isBeingRidden() ? (this.getControllingPassenger() instanceof EntityPlayer ? ((EntityPlayer)this.getControllingPassenger()).isCreative() : false) : false;
boolean flag2 = this.isBeingRidden() && (this.getControllingPassenger() instanceof EntityPlayer && ((EntityPlayer) this.getControllingPassenger()).isCreative());
for (int x = this.creatureInventory.getSizeInventory() - 1; x >= 0; x--) {
if (!this.creatureInventory.getStackInSlot(x).isEmpty()) {
if (this.creatureInventory.getStackInSlot(x).getItem().equals(RiftItems.CATAPULT_BOULDER)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,6 @@ public void onLivingUpdate() {
if (this.world.isRemote) {
this.setControls();
}
System.out.println("lc use: "+this.getLeftClickUse());
System.out.println("lc cooldown: "+this.getLeftClickCooldown());
}

@SideOnly(Side.CLIENT)
Expand Down

0 comments on commit c5916ab

Please sign in to comment.