Skip to content

Commit

Permalink
Last preparations for next update
Browse files Browse the repository at this point in the history
  • Loading branch information
ThexXTURBOXx committed Jun 6, 2017
1 parent 12d9e44 commit a318667
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 53 deletions.
2 changes: 1 addition & 1 deletion java/org/silvercatcher/reforged/ReforgedMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class ReforgedMod {

public static final String NAME = "Reforged";
public static final String ID = "reforged";
public static final String VERSION = "0.7.3";
public static final String VERSION = "0.7.4";
public static final String UPDATE_JSON = "https://raw.githubusercontent.com/ThexXTURBOXx/UpdateJSONs/master/reforged.json";

@CapabilityInject(IStunProperty.class)
Expand Down
9 changes: 5 additions & 4 deletions java/org/silvercatcher/reforged/api/AReloadable.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer play

compound.setByte(CompoundTags.AMMUNITION, loadState);

if(compound.getInteger(CompoundTags.TIME) <= 0 || !worldIn.isRemote || (worldIn.isRemote && compound.getInteger(CompoundTags.TIME) >= getReloadTotal() - 1)) {
if (compound.getInteger(CompoundTags.TIME) <= 0 || !worldIn.isRemote
|| (worldIn.isRemote && compound.getInteger(CompoundTags.TIME) >= getReloadTotal() - 1)) {
playerIn.setActiveHand(hand);
}

Expand All @@ -150,7 +151,7 @@ public EnumActionResult onItemUse(EntityPlayer player, World worldIn, BlockPos p
EnumFacing facing, float hitX, float hitY, float hitZ) {
return EnumActionResult.PASS;
}

@Override
public ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityLivingBase playerIn) {

Expand All @@ -172,8 +173,8 @@ public void onPlayerStoppedUsing(ItemStack stack, World worldIn, EntityLivingBas
if (loadState == loaded) {
Helpers.playSound(worldIn, playerIn, shootsound, 1f, 1f);
shoot(worldIn, playerIn, stack);
if (!playerIn.capabilities.isCreativeMode &&
stack.getItem().isDamageable() && stack.attemptDamageItem(5, itemRand)) {
if (!playerIn.capabilities.isCreativeMode && stack.getItem().isDamageable()
&& stack.attemptDamageItem(5, itemRand)) {
playerIn.renderBrokenItemStack(stack);
Helpers.destroyCurrentEquippedItem(playerIn);
}
Expand Down
8 changes: 4 additions & 4 deletions java/org/silvercatcher/reforged/blocks/BlockCaltrop.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ public boolean isOpaqueCube(IBlockState state) {
public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) {
if (entityIn instanceof EntityLivingBase) {
EntityLivingBase e = (EntityLivingBase) entityIn;
e.attackEntityFrom(new DamageSource("caltrop").setDamageBypassesArmor(), 8);
if (!worldIn.isRemote)
worldIn.setBlockToAir(pos);
}
e.attackEntityFrom(new DamageSource("caltrop").setDamageBypassesArmor(), 8);
if (!worldIn.isRemote)
worldIn.setBlockToAir(pos);
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public void onUpdated() {
}
}
}
this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F;
rotationYaw = prevRotationYaw + (rotationYaw - prevRotationYaw) * 0.2F;
rotationYaw += 20;
}

Expand Down
46 changes: 23 additions & 23 deletions java/org/silvercatcher/reforged/entities/EntityDynamite.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,29 +27,6 @@ public EntityDynamite(World worldIn, EntityLivingBase throwerIn, ItemStack stack
setInited();
}

@Override
protected float getGravityVelocity() {
return 0.05F;
}

@Override
protected float getImpactDamage(Entity target) {

return 0f;
}

@Override
protected boolean onBlockHit(BlockPos blockPos) {
world.createExplosion(this, posX, posY, posZ, 2, true);
return true;
}

@Override
protected boolean onEntityHit(Entity entity) {
world.createExplosion(this, posX, posY, posZ, 2, true);
return true;
}

public void explodeDamage(Explosion e, Entity exploder, int size, double x, double y, double z) {
float f3 = size * 2.0F;
int j = MathHelper.floor(x - f3 - 1.0D);
Expand Down Expand Up @@ -80,6 +57,29 @@ public void explodeDamage(Explosion e, Entity exploder, int size, double x, doub
}
}

@Override
protected float getGravityVelocity() {
return 0.05F;
}

@Override
protected float getImpactDamage(Entity target) {

return 0f;
}

@Override
protected boolean onBlockHit(BlockPos blockPos) {
world.createExplosion(this, posX, posY, posZ, 2, true);
return true;
}

@Override
protected boolean onEntityHit(Entity entity) {
world.createExplosion(this, posX, posY, posZ, 2, true);
return true;
}

public DamageSource setExplosionSource(Explosion explosionIn) {
return explosionIn != null && explosionIn.getExplosivePlacedBy() != null
? (new EntityDamageSource("explosion.player", explosionIn.getExplosivePlacedBy())).setDifficultyScaled()
Expand Down
25 changes: 13 additions & 12 deletions java/org/silvercatcher/reforged/items/weapons/ItemCrossbow.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public float apply(ItemStack stack, @Nullable World worldIn, @Nullable EntityLiv
mrl = 2;
} else if (left > 4) {
mrl = 4;
} else if(left >= 0) {
} else if (left >= 0) {
mrl = 5;
}
} else if (getLoadState(stack) == loaded) {
Expand Down Expand Up @@ -188,15 +188,22 @@ public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer play

compound.setByte(CompoundTags.AMMUNITION, loadState);

if(compound.getInteger(CompoundTags.TIME) <= 0 || !worldIn.isRemote || (worldIn.isRemote && compound.getInteger(CompoundTags.TIME) >= getReloadTotal() - 1)) {
if (compound.getInteger(CompoundTags.TIME) <= 0 || !worldIn.isRemote
|| (worldIn.isRemote && compound.getInteger(CompoundTags.TIME) >= getReloadTotal() - 1)) {
playerIn.setActiveHand(hand);
}

return new ActionResult(EnumActionResult.SUCCESS, playerIn.getHeldItemMainhand());
}
return new ActionResult<ItemStack>(EnumActionResult.FAIL, playerIn.getHeldItemOffhand());
}

@Override
public EnumActionResult onItemUse(EntityPlayer player, World worldIn, BlockPos pos, EnumHand hand,
EnumFacing facing, float hitX, float hitY, float hitZ) {
return EnumActionResult.PASS;
}

@Override
public ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityLivingBase playerIn) {
byte loadState = giveCompound(stack).getByte(CompoundTags.AMMUNITION);
Expand All @@ -206,12 +213,6 @@ public ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityLivingBas
giveCompound(stack).setByte(CompoundTags.AMMUNITION, loadState);
return stack;
}

@Override
public EnumActionResult onItemUse(EntityPlayer player, World worldIn, BlockPos pos, EnumHand hand,
EnumFacing facing, float hitX, float hitY, float hitZ) {
return EnumActionResult.PASS;
}

@Override
public void onPlayerStoppedUsing(ItemStack stack, World worldIn, EntityLivingBase playerInl, int timeLeft) {
Expand All @@ -237,9 +238,9 @@ public void onPlayerStoppedUsing(ItemStack stack, World worldIn, EntityLivingBas
@Override
public void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected) {
super.onUpdate(stack, worldIn, entityIn, itemSlot, isSelected);
if (giveCompound(stack).getBoolean(CompoundTags.STARTED) && getLoadState(stack) == loading) {
giveCompound(stack).setInteger(CompoundTags.TIME, getReloadTime(stack) + 1);
}
if (giveCompound(stack).getBoolean(CompoundTags.STARTED) && getLoadState(stack) == loading) {
giveCompound(stack).setInteger(CompoundTags.TIME, getReloadTime(stack) + 1);
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public ItemKeris() {
public Multimap getAttributeModifiers(ItemStack stack) {
return ItemExtension.super.getAttributeModifiers(stack);
}

@Override
public float getDamageVsEntity() {
return getHitDamage();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ public ItemNestOfBees() {
@SideOnly(Side.CLIENT)
public float apply(ItemStack stack, @Nullable World worldIn, @Nullable EntityLivingBase entityIn) {
float mrl = 1;
if(stack.getItem() instanceof ItemNestOfBees && CompoundTags.giveCompound(stack).getInteger(CompoundTags.AMMUNITION) > 0) {
if (stack.getItem() instanceof ItemNestOfBees
&& CompoundTags.giveCompound(stack).getInteger(CompoundTags.AMMUNITION) > 0) {
mrl = 0;
}
return mrl;
Expand Down
4 changes: 2 additions & 2 deletions java/org/silvercatcher/reforged/proxy/ClientProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ protected void registerItemRenderers() {
ItemModelMesher mesher = Minecraft.getMinecraft().getRenderItem().getItemModelMesher();

String inventory = "inventory";

for (Item item : ReforgedRegistry.registrationList) {
mesher.register(item, 0, new ModelResourceLocation(
ReforgedMod.ID + ":" + item.getUnlocalizedName().substring(5), inventory));
Expand All @@ -130,7 +130,7 @@ protected void registerItemRenderers() {
mesher.register(Item.getItemFromBlock(item), 0, new ModelResourceLocation(
ReforgedMod.ID + ":" + item.getUnlocalizedName().substring(5), inventory));
}

}

}
8 changes: 4 additions & 4 deletions resources/assets/reforged/models/item/musket.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"scale": [ 1.10, 1.10, 1.10 ]
},
"firstperson_righthand": {
"rotation": [ -180, 267, 199 ],
"translation": [ 7.00, 11.50, -15.25 ],
"rotation": [ 344, 273, 25 ],
"translation": [ 7.00, 2.25, -15.25 ],
"scale": [ 2.25, 2.25, 2.25 ]
},
"thirdperson_lefthand": {
Expand All @@ -20,8 +20,8 @@
"scale": [ 1.10, 1.10, 1.10 ]
},
"firstperson_lefthand": {
"rotation": [ 0, 93, -19 ],
"translation": [ 7.00, 11.50, -15.25 ],
"rotation": [ 154, 87, 165 ],
"translation": [ 7.00, 2.25, -15.25 ],
"scale": [ 2.25, 2.25, 2.25 ]
}
}
Expand Down

0 comments on commit a318667

Please sign in to comment.