Skip to content

Commit

Permalink
for 0.0.11.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ANightDazingZoroark committed Jul 7, 2024
1 parent fc72670 commit e9f0515
Show file tree
Hide file tree
Showing 18 changed files with 267 additions and 25 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
org.gradle.jvmargs = -Xmx4G

# Mod Information
mod_version = 0.0.11
mod_version = 0.0.11.1
maven_group = anightdazingzoroark.prift
archives_base_name = prift

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class RiftInitialize {
public static final String SIMPLE_DIFFICULTY_MOD_ID = "simpledifficulty";
public static final String MYSTICAL_MECHANICS_MOD_ID = "mysticalmechanics";
public static final String MODNAME = "Prehistoric Rift";
public static final String MODVERSION= "0.0.11";
public static final String MODVERSION= "0.0.11.1";
@SidedProxy(clientSide = "anightdazingzoroark.prift.client.ClientProxy", serverSide = "anightdazingzoroark.prift.server.ServerProxy")
public static ServerProxy PROXY;
@Mod.Instance(MODID)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
private void drawProgressBar() {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
float progress = (float)this.semiManualPresser.getTopTEntity().getTimeHeld();
System.out.println("progress: "+progress);
float max = (float)this.semiManualPresser.getTopTEntity().getMaxRecipeTime();
float fill = progress / max * 21f;
this.mc.getTextureManager().bindTexture(progressBar);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;

public class RiftHammer extends Item {
public RiftHammer() {
public class RiftMMCraftingTool extends Item {
public RiftMMCraftingTool() {
super();
this.setMaxStackSize(1);
this.setMaxDamage(64);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package anightdazingzoroark.prift.compat.mysticalmechanics.items;

import anightdazingzoroark.prift.compat.mysticalmechanics.blocks.BlockSemiManualBase;
import anightdazingzoroark.prift.compat.mysticalmechanics.blocks.RiftMMBlocks;
import anightdazingzoroark.prift.config.GeneralConfig;
import anightdazingzoroark.prift.server.items.RiftItems;
Expand Down Expand Up @@ -28,6 +27,7 @@ public class RiftMMItems {
public static Item IRON_ROD;
public static Item GOLD_ROD;
public static Item HAMMER;
public static Item FILE;

public static void registerMMItems() {
BLOW_POWERED_TURBINE = riftBlowPoweredTurbineItem("blow_powered_turbine");
Expand All @@ -46,7 +46,8 @@ public static void registerMMItems() {
GOLD_PLATE = RiftItems.riftGenericItem("gold_plate", true);
IRON_ROD = RiftItems.riftGenericItem("iron_rod", true);
GOLD_ROD = RiftItems.riftGenericItem("gold_rod", true);
HAMMER = RiftItems.registerItem(new RiftHammer(), "hammer", true);
HAMMER = RiftItems.registerItem(new RiftMMCraftingTool(), "hammer", true);
FILE = RiftItems.registerItem(new RiftMMCraftingTool(), "file", true);
}

public static void registerOreDicTags() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@
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;
import anightdazingzoroark.prift.server.entity.RiftCreatureType;
import anightdazingzoroark.prift.server.entity.RiftLargeWeaponType;
import anightdazingzoroark.prift.server.entity.ai.*;
import anightdazingzoroark.prift.server.entity.interfaces.IWorkstationUser;
import anightdazingzoroark.prift.server.entity.projectile.RiftCannonball;
import anightdazingzoroark.prift.server.entity.projectile.RiftCatapultBoulder;
import anightdazingzoroark.prift.server.entity.projectile.RiftMortarShell;
Expand All @@ -18,6 +24,9 @@
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;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.culling.ICamera;
import net.minecraft.client.settings.GameSettings;
Expand All @@ -31,11 +40,10 @@
import net.minecraft.network.datasync.DataParameter;
import net.minecraft.network.datasync.DataSerializers;
import net.minecraft.network.datasync.EntityDataManager;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumHand;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.*;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.world.World;
Expand All @@ -56,7 +64,7 @@
import java.util.List;
import java.util.UUID;

public class Apatosaurus extends RiftCreature {
public class Apatosaurus extends RiftCreature implements IWorkstationUser {
public static final ResourceLocation LOOT = LootTableList.register(new ResourceLocation(RiftInitialize.MODID, "entities/apatosaurus"));
private static final DataParameter<Byte> WEAPON = EntityDataManager.createKey(Apatosaurus.class, DataSerializers.BYTE);
private static final DataParameter<Boolean> LAUNCHING = EntityDataManager.createKey(Apatosaurus.class, DataSerializers.BOOLEAN);
Expand Down Expand Up @@ -123,6 +131,7 @@ protected void initEntityAI() {
this.targetTasks.addTask(2, new RiftAggressiveModeGetTargets(this, true));
this.targetTasks.addTask(2, new RiftProtectOwner(this));
this.targetTasks.addTask(3, new RiftAttackForOwner(this));
this.tasks.addTask(0, new RiftUseSemiManualMachine(this, 3f, 3f));
this.tasks.addTask(1, new RiftMate(this));
this.tasks.addTask(2, new RiftLandDwellerSwim(this));
this.tasks.addTask(3, new RiftApatosaurusControlledTailWhip(this, 0.6F, 0.4F));
Expand Down Expand Up @@ -379,6 +388,53 @@ public void readEntityFromNBT(NBTTagCompound compound) {
if (compound.hasKey("Weapon")) this.setWeapon(RiftLargeWeaponType.values()[compound.getByte("Weapon")]);
}

@Override
public boolean canUseWorkstation() {
return GeneralConfig.canUseMM();
}

@Override
public boolean isWorkstation(BlockPos pos) {
Block block = this.world.getBlockState(pos).getBlock();
if (GeneralConfig.canUseMM()) {
return block instanceof BlockSemiManualBase;
}
return false;
}

@Override
public BlockPos workstationUseFromPos() {
IBlockState blockState = this.world.getBlockState(this.getWorkstationPos());
TileEntity te = this.world.getTileEntity(this.getWorkstationPos());
int dirF = te instanceof TileEntitySemiManualBase ? -1 : 1;
if (blockState.getMaterial().isSolid()) {
EnumFacing direction = blockState.getValue(BlockHorizontal.FACING);
switch (direction) {
case NORTH:
return this.getWorkstationPos().add(0, 0, 5);
case SOUTH:
return this.getWorkstationPos().add(0, 0, -5);
case EAST:
return this.getWorkstationPos().add(-5, 0, 0);
case WEST:
return this.getWorkstationPos().add(5, 0, 0);
}
}
return null;
}

public boolean isUsingWorkAnim() {
return this.isAttacking();
}

public void setUsingWorkAnim(boolean value) {
this.setAttacking(value);
}

public SoundEvent useAnimSound() {
return null;
}

public boolean isTameableByFeeding() {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package anightdazingzoroark.prift.server.entity.creature;

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.*;
import anightdazingzoroark.prift.RiftInitialize;
import anightdazingzoroark.prift.RiftUtil;
Expand Down Expand Up @@ -52,7 +54,7 @@
import java.util.List;
import java.util.Set;

public class Tyrannosaurus extends RiftCreature implements IAnimatable, IApexPredator, IWorkstationUser {
public class Tyrannosaurus extends RiftCreature implements IApexPredator, IWorkstationUser {
public static final ResourceLocation LOOT = LootTableList.register(new ResourceLocation(RiftInitialize.MODID, "entities/tyrannosaurus"));
private static final Predicate<EntityLivingBase> WEAKNESS_BLACKLIST = new Predicate<EntityLivingBase>() {
@Override
Expand Down Expand Up @@ -119,6 +121,7 @@ public boolean apply(@Nullable EntityLivingBase entity) {
}
};
private static final DataParameter<Boolean> ROARING = EntityDataManager.<Boolean>createKey(Tyrannosaurus.class, DataSerializers.BOOLEAN);
private static final DataParameter<Boolean> STOMPING = EntityDataManager.<Boolean>createKey(Tyrannosaurus.class, DataSerializers.BOOLEAN);
private static final DataParameter<Boolean> CAN_ROAR = EntityDataManager.<Boolean>createKey(Tyrannosaurus.class, DataSerializers.BOOLEAN);
public int roarCooldownTicks;
public int roarCharge;
Expand Down Expand Up @@ -157,6 +160,7 @@ public Tyrannosaurus(World worldIn) {
protected void entityInit() {
super.entityInit();
this.dataManager.register(CAN_ROAR, true);
this.dataManager.register(STOMPING, false);
this.dataManager.register(ROARING, false);
this.setCanPickUpLoot(true);
}
Expand All @@ -177,6 +181,7 @@ protected void initEntityAI() {
this.targetTasks.addTask(3, new RiftPickUpFavoriteFoods(this,true));
this.targetTasks.addTask(3, new RiftAttackForOwner(this));
this.tasks.addTask(0, new RiftBlowIntoTurbine(this, 180f, 2.08f, 0.64f));
this.tasks.addTask(0, new RiftUseSemiManualMachine(this, 1.04f, 0.64f));
this.tasks.addTask(1, new RiftLandDwellerSwim(this));
this.tasks.addTask(2, new RiftMate(this));
this.tasks.addTask(3, new RiftResetAnimatedPose(this, 1.68F, 1));
Expand Down Expand Up @@ -415,58 +420,73 @@ public boolean canUseWorkstation() {
public boolean isWorkstation(BlockPos pos) {
Block block = this.world.getBlockState(pos).getBlock();
if (GeneralConfig.canUseMM()) {
if (block instanceof BlockBlowPoweredTurbine) return true;
return block instanceof BlockBlowPoweredTurbine || block instanceof BlockSemiManualBase;
}
return false;
}

@Override
public BlockPos workstationUseFromPos() {
IBlockState blockState = this.world.getBlockState(this.getWorkstationPos());
TileEntity te = this.world.getTileEntity(this.getWorkstationPos());
int downF = 0;
int dirF = te instanceof TileEntitySemiManualBase ? -1 : 1;
if (GeneralConfig.canUseMM()) {
TileEntity te = this.world.getTileEntity(this.getWorkstationPos());
if (te != null) downF = te instanceof TileEntityBlowPoweredTurbine ? -1 : 0;
}
if (blockState.getMaterial().isSolid()) {
EnumFacing direction = blockState.getValue(BlockHorizontal.FACING);
switch (direction) {
case NORTH:
return this.getWorkstationPos().add(0, downF, -4);
return this.getWorkstationPos().add(0, downF, -4 * dirF);
case SOUTH:
return this.getWorkstationPos().add(0, downF, 4);
return this.getWorkstationPos().add(0, downF, 4 * dirF);
case EAST:
return this.getWorkstationPos().add(4, downF, 0);
return this.getWorkstationPos().add(4 * dirF, downF, 0);
case WEST:
return this.getWorkstationPos().add(-4, downF, 0);
return this.getWorkstationPos().add(-4 * dirF, downF, 0);
}
}
return null;
}

public boolean isUsingWorkAnim() {
return this.isRoaring();
if (this.world.getTileEntity(this.getWorkstationPos()) instanceof TileEntityBlowPoweredTurbine) return this.isRoaring();
else if (this.world.getTileEntity(this.getWorkstationPos()) instanceof TileEntitySemiManualBase) return this.isStomping();
return false;
}

public void setUsingWorkAnim(boolean value) {
this.setRoaring(value);
if (this.world.getTileEntity(this.getWorkstationPos()) instanceof TileEntityBlowPoweredTurbine) this.setRoaring(value);
else if (this.world.getTileEntity(this.getWorkstationPos()) instanceof TileEntitySemiManualBase) this.setStomping(value);
}

public SoundEvent useAnimSound() {
return RiftSounds.TYRANNOSAURUS_ROAR;
}

public void setRoaring(boolean value) {
this.dataManager.set(ROARING, Boolean.valueOf(value));
System.out.println("is roaring: "+value);
this.dataManager.set(ROARING, value);
this.setActing(value);
}

public boolean isRoaring() {
return this.dataManager.get(ROARING);
}

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

public boolean isStomping() {
return this.dataManager.get(STOMPING);
}

public void setCanRoar(boolean value) {
this.dataManager.set(CAN_ROAR, Boolean.valueOf(value));
this.dataManager.set(CAN_ROAR, value);
}

public boolean canRoar() {
Expand Down Expand Up @@ -555,6 +575,7 @@ public void registerControllers(AnimationData data) {
data.addAnimationController(new AnimationController(this, "movement", 0, this::tyrannosaurusMovement));
data.addAnimationController(new AnimationController(this, "attacking", 0, this::tyrannosaurusAttack));
data.addAnimationController(new AnimationController(this, "roaring", 0, this::tyrannosaurusRoar));
data.addAnimationController(new AnimationController(this, "stomping", 0, this::tyrannosaurusStomp));
data.addAnimationController(new AnimationController(this, "controlled_roar", 0, this::tyrannosaurusControlledRoar));
}

Expand Down Expand Up @@ -596,6 +617,16 @@ private <E extends IAnimatable> PlayState tyrannosaurusRoar(AnimationEvent<E> ev
return PlayState.CONTINUE;
}

private <E extends IAnimatable> PlayState tyrannosaurusStomp(AnimationEvent<E> event) {
if (this.isStomping()) {
event.getController().setAnimation(new AnimationBuilder().addAnimation("animation.tyrannosaurus.stomp", false));
}
else {
event.getController().clearAnimationCache();
}
return PlayState.CONTINUE;
}

private <E extends IAnimatable> PlayState tyrannosaurusControlledRoar(AnimationEvent<E> event) {
if (this.getRightClickCooldown() == 0) {
if (this.getRightClickUse() > 0 && this.getRightClickUse() < 100) event.getController().setAnimation(new AnimationBuilder().addAnimation("animation.tyrannosaurus.use_roar_p1", false));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,52 @@
"rotation": [70, 0, 0]
}
}
},
"animation.tyrannosaurus.stomp": {
"animation_length": 1.0417,
"bones": {
"body": {
"rotation": {
"0.0": [0, 0, 0],
"0.5": [-17.5, 0, 0],
"0.625": [5, 0, 0],
"1.0417": [0, 0, 0]
}
},
"neck": {
"rotation": {
"0.0": [0, 0, 0],
"0.5": [17.5, 0, 0],
"0.625": [17.5, 0, 0],
"1.0417": [0, 0, 0]
}
},
"leftLeg": {
"rotation": {
"0.0": [0, 0, 0],
"0.5": [-75, 0, 0],
"0.625": [-40, 0, 0],
"0.75": [-40, 0, 0],
"1.0417": [0, 0, 0]
}
},
"leftShin": {
"rotation": {
"0.0": [0, 0, 0],
"0.5": [75, 0, 0],
"0.625": [40, 0, 0],
"0.75": [40, 0, 0],
"1.0417": [0, 0, 0]
},
"position": {
"0.0": [0, 0, 0],
"0.5": [0, -1, -1],
"0.625": [0, -1, -0.375],
"0.75": [0, -1, -0.375],
"1.0417": [0, 0, 0]
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
{
"name": "leftShin",
"parent": "leftLeg",
"pivot": [0, 0, 0],
"pivot": [-6, 9.5, 14],
"cubes": [
{"origin": [-7.5, 1.5, 13], "size": [3, 9, 4], "inflate": -0.25, "uv": [0, 24]}
]
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/prift/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ item.semi_manual_extruder_core.name=Semi Manual Extruder Core
item.semi_manual_hammerer_core.name=Semi Manual Hammerer Core
item.semi_manual_machine_frame.name=Semi Manual Machine Frame
item.hammer.name=Hammer
item.file.name=File
item.bola.name=Bola

item.tyrannosaurus_arm.name=Tyrannosaurus Arm
Expand Down
Loading

0 comments on commit e9f0515

Please sign in to comment.