Skip to content

Commit

Permalink
finishing 0.0.11.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ANightDazingZoroark committed Jul 9, 2024
1 parent e9f0515 commit b12c041
Show file tree
Hide file tree
Showing 24 changed files with 670 additions and 71 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@ public class RiftSounds {
@GameRegistry.ObjectHolder("prift.megaloceros.death")
public static final SoundEvent MEGALOCEROS_DEATH = createSoundEvent("prift.megaloceros.death");

@GameRegistry.ObjectHolder("prift.semi_manual_machine.reset")
public static final SoundEvent SEMI_MANUAL_MACHINE_RESET = createSoundEvent("prift.semi_manual_machine.reset");

@GameRegistry.ObjectHolder("prift.semi_manual_machine.jammed")
public static final SoundEvent SEMI_MANUAL_MACHINE_JAMMED = createSoundEvent("prift.semi_manual_machine.jammed");

private static SoundEvent createSoundEvent(String soundName) {
ResourceLocation soundID = new ResourceLocation(RiftInitialize.MODID, soundName);
return new SoundEvent(soundID).setRegistryName(soundID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import anightdazingzoroark.prift.compat.mysticalmechanics.blocks.BlockSemiManualBase;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.inventory.ItemStackHelper;
import net.minecraft.item.ItemStack;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,29 @@
import anightdazingzoroark.prift.compat.mysticalmechanics.ConsumerMechCapability;
import anightdazingzoroark.prift.compat.mysticalmechanics.blocks.BlockSemiManualBase;
import anightdazingzoroark.prift.compat.mysticalmechanics.recipes.RiftMMRecipes;
import anightdazingzoroark.prift.compat.mysticalmechanics.recipes.SemiManualExtractorRecipe;
import anightdazingzoroark.prift.compat.mysticalmechanics.recipes.SemiManualRecipeBase;
import mysticalmechanics.api.IMechCapability;
import mysticalmechanics.api.MysticalMechanicsAPI;
import mysticalmechanics.util.Misc;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.play.server.SPacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.ITickable;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.common.capabilities.Capability;

import javax.annotation.Nullable;
import java.util.List;
import java.util.Random;

public class TileEntitySemiManualTopBase extends TileEntity implements ITickable {
Expand All @@ -42,7 +47,12 @@ public void onPowerChange() {
@Override
public void update() {
if (this.world.isRemote) {
//add smoke particles when it needs to reset
//get nearby players that will hear the sounds
AxisAlignedBB hearRange = new AxisAlignedBB(this.getPos().getX() - 8, this.getPos().getY() - 8, this.getPos().getZ() - 8, this.getPos().getX() + 8, this.getPos().getY() + 8, this.getPos().getZ() + 8);
List<EntityPlayer> playerList = this.world.getEntitiesWithinAABB(EntityPlayer.class, hearRange, null);
if (this.getPower() > 0 && this.world.rand.nextInt(40) < 2) for (EntityPlayer player : playerList) this.world.playSound(player, this.pos, SoundEvents.ENTITY_MINECART_RIDING, SoundCategory.BLOCKS, 0.75F, this.world.rand.nextFloat() * 0.4F + 0.8F);

//add smoke particles and make jamming sounds when it needs to reset
Random rand = new Random();
double motionX = rand.nextGaussian() * 0.07D;
double motionY = rand.nextGaussian() * 0.07D;
Expand Down Expand Up @@ -135,6 +145,10 @@ public void setMustBeReset(boolean value) {
}
}

public TileEntitySemiManualBase getBottomTEntity() {
return (TileEntitySemiManualBase)this.world.getTileEntity(this.pos.down());
}

@Override
public boolean shouldRefresh(World world, BlockPos pos, IBlockState oldState, IBlockState newSate) {
return oldState.getBlock() != newSate.getBlock();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
package anightdazingzoroark.prift.server.entity.ai;

import anightdazingzoroark.prift.RiftInitialize;
import anightdazingzoroark.prift.RiftUtil;
import anightdazingzoroark.prift.client.RiftSounds;
import anightdazingzoroark.prift.compat.mysticalmechanics.tileentities.TileEntityBlowPoweredTurbine;
import anightdazingzoroark.prift.config.GeneralConfig;
import anightdazingzoroark.prift.server.entity.creature.RiftCreature;
import anightdazingzoroark.prift.server.entity.interfaces.IWorkstationUser;
import com.codetaylor.mc.pyrotech.modules.tech.machine.tile.spi.TileCombustionWorkerStoneBase;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraftforge.fml.common.Loader;

public class RiftBlowIntoTurbine extends EntityAIBase {
private final RiftCreature creature;
Expand Down Expand Up @@ -80,7 +76,7 @@ public void updateTask() {
}
if (this.animTime == this.animLength) {
this.user.setUsingWorkAnim(false);
this.creature.setEnergy(this.creature.getEnergy() - 3);
this.creature.energyActionMod++;
this.creature.setXP(this.creature.getXP() + 5);
}
if (this.animTime > 120) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package anightdazingzoroark.prift.server.entity.ai;

import anightdazingzoroark.prift.client.RiftSounds;
import anightdazingzoroark.prift.server.entity.creature.RiftCreature;
import anightdazingzoroark.prift.server.entity.interfaces.IPackHunter;
import com.google.common.base.Predicate;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package anightdazingzoroark.prift.server.entity.ai;

import anightdazingzoroark.prift.client.RiftSounds;
import anightdazingzoroark.prift.server.entity.creature.RiftCreature;
import anightdazingzoroark.prift.server.entity.interfaces.IPackHunter;
import com.google.common.base.Predicate;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
package anightdazingzoroark.prift.server.entity.ai;

import anightdazingzoroark.prift.RiftInitialize;
import anightdazingzoroark.prift.RiftUtil;
import anightdazingzoroark.prift.client.RiftSounds;
import anightdazingzoroark.prift.config.GeneralConfig;
import anightdazingzoroark.prift.server.entity.creature.Parasaurolophus;
import com.codetaylor.mc.pyrotech.IAirflowConsumerCapability;
import com.codetaylor.mc.pyrotech.modules.core.ModuleCore;
import com.codetaylor.mc.pyrotech.modules.tech.bloomery.tile.TileBloomery;
import com.codetaylor.mc.pyrotech.modules.tech.machine.tile.spi.TileCombustionWorkerStoneBase;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraftforge.fml.common.Loader;

import java.util.List;

public class RiftParasaurStokeCombustor extends EntityAIBase {
private Parasaurolophus parasaur;
Expand Down Expand Up @@ -77,7 +69,10 @@ public void updateTask() {
this.parasaur.setBlowing(true);
this.parasaur.playSound(RiftSounds.PARASAUROLOPHUS_BLOW, 2, 1);
}
if (this.animTime == this.animBlowTime) stoked.consumeAirflow(8f, false);
if (this.animTime == this.animBlowTime) {
stoked.consumeAirflow(8f, false);
this.parasaur.setXP(this.parasaur.getXP() + 5);
}
}
}
if (tileEntity instanceof TileBloomery) {
Expand All @@ -87,13 +82,15 @@ public void updateTask() {
this.parasaur.setBlowing(true);
this.parasaur.playSound(RiftSounds.PARASAUROLOPHUS_BLOW, 2, 1);
}
if (this.animTime == this.animBlowTime) stoked.consumeAirflow(8f, false);
if (this.animTime == this.animBlowTime) {
stoked.consumeAirflow(8f, false);
this.parasaur.setXP(this.parasaur.getXP() + 5);
}
}
}
if (this.animTime == this.animLength) {
this.parasaur.setBlowing(false);
this.parasaur.setEnergy(this.parasaur.getEnergy() - 3);
this.parasaur.setXP(this.parasaur.getXP() + 5);
this.parasaur.energyActionMod++;
}
if (this.animTime > 120) {
this.animTime = -1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,7 @@

import anightdazingzoroark.prift.client.RiftSounds;
import anightdazingzoroark.prift.server.entity.creature.Saurophaganax;
import com.google.common.base.Predicate;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.DamageSource;
import net.minecraft.util.math.AxisAlignedBB;

import javax.annotation.Nullable;
import java.util.List;

public class RiftSaurophaganaxUseLightBlast extends EntityAIBase {
protected final Saurophaganax saurophaganax;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ public void updateTask() {
if (this.creature.getEnergy() > 6) {
if (this.animTime == 0 && semiManualBase.getTopTEntity().getMustBeReset() && !semiManualBase.canDoResetAnim()) {
this.user.setUsingWorkAnim(true);
this.creature.playSound(this.user.useAnimSound(), 2, 1);
}
if (this.animTime == this.animStompTime && semiManualBase.getTopTEntity().getMustBeReset() && !semiManualBase.canDoResetAnim()) {
semiManualBase.setPlayResetAnim(true);
semiManualBase.getTopTEntity().setMustBeReset(false);
this.creature.playSound(this.user.useAnimSound(), 2, 1);
}
if (this.animTime == this.animLength) {
this.user.setUsingWorkAnim(false);
this.creature.setEnergy(this.creature.getEnergy() - 3);
this.creature.energyActionMod++;
this.creature.setXP(this.creature.getXP() + 5);
this.animTime = -1;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import software.bernie.geckolib3.core.manager.AnimationData;

import javax.annotation.Nullable;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
import anightdazingzoroark.prift.RiftUtil;
import anightdazingzoroark.prift.SSRCompatUtils;
import anightdazingzoroark.prift.client.RiftSounds;
import anightdazingzoroark.prift.compat.mysticalmechanics.blocks.BlockBlowPoweredTurbine;
import anightdazingzoroark.prift.compat.mysticalmechanics.blocks.BlockSemiManualBase;
import anightdazingzoroark.prift.compat.mysticalmechanics.tileentities.TileEntityBlowPoweredTurbine;
import anightdazingzoroark.prift.compat.mysticalmechanics.tileentities.TileEntitySemiManualBase;
import anightdazingzoroark.prift.config.ApatosaurusConfig;
import anightdazingzoroark.prift.config.GeneralConfig;
Expand All @@ -23,7 +21,6 @@
import anightdazingzoroark.prift.server.items.RiftLargeWeaponItem;
import anightdazingzoroark.prift.server.message.*;
import com.google.common.base.Predicate;
import com.teamderpy.shouldersurfing.client.ShoulderInstance;
import net.minecraft.block.Block;
import net.minecraft.block.BlockHorizontal;
import net.minecraft.block.state.IBlockState;
Expand All @@ -48,7 +45,6 @@
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.world.World;
import net.minecraft.world.storage.loot.LootTableList;
import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import software.bernie.geckolib3.core.IAnimatable;
Expand All @@ -60,7 +56,6 @@

import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;

Expand Down Expand Up @@ -432,7 +427,7 @@ public void setUsingWorkAnim(boolean value) {
}

public SoundEvent useAnimSound() {
return null;
return RiftSounds.SEMI_MANUAL_MACHINE_RESET;
}

public boolean isTameableByFeeding() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import anightdazingzoroark.prift.RiftInitialize;
import anightdazingzoroark.prift.RiftUtil;
import anightdazingzoroark.prift.client.RiftSounds;
import anightdazingzoroark.prift.config.CoelacanthConfig;
import anightdazingzoroark.prift.config.DimetrodonConfig;
import anightdazingzoroark.prift.config.DodoConfig;
import anightdazingzoroark.prift.server.entity.RiftCreatureType;
import anightdazingzoroark.prift.server.entity.ai.*;
Expand All @@ -13,7 +11,6 @@
import net.minecraft.util.DamageSource;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
import net.minecraft.world.storage.loot.LootTableList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.world.World;
import net.minecraft.world.storage.loot.LootTableList;
import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import software.bernie.geckolib3.core.IAnimatable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import net.ilexiconn.llibrary.server.entity.EntityPropertiesHandler;
import net.minecraft.client.renderer.culling.ICamera;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.passive.EntityTameable;
Expand All @@ -41,7 +40,6 @@
import software.bernie.geckolib3.core.manager.AnimationData;

import javax.annotation.Nullable;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,21 @@
import anightdazingzoroark.prift.RiftUtil;
import anightdazingzoroark.prift.client.RiftSounds;
import anightdazingzoroark.prift.compat.mysticalmechanics.blocks.BlockLeadPoweredCrank;
import anightdazingzoroark.prift.config.DimetrodonConfig;
import anightdazingzoroark.prift.config.GeneralConfig;
import anightdazingzoroark.prift.config.MegapiranhaConfig;
import anightdazingzoroark.prift.config.StegosaurusConfig;
import anightdazingzoroark.prift.server.entity.RiftCreatureType;
import anightdazingzoroark.prift.server.entity.RiftEntityProperties;
import anightdazingzoroark.prift.server.entity.ai.*;
import anightdazingzoroark.prift.server.entity.interfaces.ILeadWorkstationUser;
import anightdazingzoroark.prift.server.entity.interfaces.IWorkstationUser;
import anightdazingzoroark.prift.server.entity.projectile.ThrownStegoPlate;
import anightdazingzoroark.prift.server.enums.TameStatusType;
import com.codetaylor.mc.pyrotech.modules.tech.machine.block.spi.BlockCombustionWorkerStoneBase;
import net.ilexiconn.llibrary.server.entity.EntityPropertiesHandler;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.culling.ICamera;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IRangedAttackMob;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.monster.IMob;
import net.minecraft.entity.passive.EntityTameable;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.SoundEvents;
Expand All @@ -40,7 +35,6 @@
import net.minecraft.world.World;

import net.minecraft.world.storage.loot.LootTableList;
import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import software.bernie.geckolib3.core.IAnimatable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
import anightdazingzoroark.prift.compat.mysticalmechanics.blocks.BlockLeadPoweredCrank;
import anightdazingzoroark.prift.compat.mysticalmechanics.blocks.BlockSemiManualBase;
import anightdazingzoroark.prift.compat.mysticalmechanics.blocks.BlockSemiManualBaseTop;
import anightdazingzoroark.prift.config.DimetrodonConfig;
import anightdazingzoroark.prift.config.GeneralConfig;
import anightdazingzoroark.prift.config.MegapiranhaConfig;
import anightdazingzoroark.prift.config.TriceratopsConfig;
import anightdazingzoroark.prift.server.entity.RiftCreatureType;
import anightdazingzoroark.prift.server.entity.ai.*;
Expand All @@ -35,7 +33,6 @@
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.world.World;
import net.minecraft.world.storage.loot.LootTableList;
import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import software.bernie.geckolib3.core.IAnimatable;
Expand Down Expand Up @@ -247,7 +244,7 @@ public void setUsingWorkAnim(boolean value) {

@Override
public SoundEvent useAnimSound() {
return null;
return RiftSounds.SEMI_MANUAL_MACHINE_RESET;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,11 +462,12 @@ public void setUsingWorkAnim(boolean value) {
}

public SoundEvent useAnimSound() {
return RiftSounds.TYRANNOSAURUS_ROAR;
if (this.world.getTileEntity(this.getWorkstationPos()) instanceof TileEntityBlowPoweredTurbine) return RiftSounds.TYRANNOSAURUS_ROAR;
else if (this.world.getTileEntity(this.getWorkstationPos()) instanceof TileEntitySemiManualBase) return RiftSounds.SEMI_MANUAL_MACHINE_RESET;
return null;
}

public void setRoaring(boolean value) {
System.out.println("is roaring: "+value);
this.dataManager.set(ROARING, value);
this.setActing(value);
}
Expand All @@ -476,7 +477,6 @@ public boolean isRoaring() {
}

public void setStomping(boolean value) {
System.out.println("is stomping: "+value);
this.dataManager.set(STOMPING, value);
this.setActing(value);
}
Expand Down
Loading

0 comments on commit b12c041

Please sign in to comment.