Skip to content

Commit

Permalink
Merge pull request #190 from CannoliCatfish/dev
Browse files Browse the repository at this point in the history
Fixed armor and other bugs, added more boats
  • Loading branch information
CannoliCatfish authored Apr 11, 2021
2 parents 6c0ba0c + 8823679 commit e6350c5
Show file tree
Hide file tree
Showing 23 changed files with 236 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ public class RankineBoatRenderer extends EntityRenderer<RankineBoatEntity> {
new ResourceLocation("rankine:textures/entity/boat/magnolia.png"),
new ResourceLocation("rankine:textures/entity/boat/eastern_hemlock.png"),
new ResourceLocation("rankine:textures/entity/boat/maple.png"),
new ResourceLocation("rankine:textures/entity/boat/black_walnut.png"),
new ResourceLocation("rankine:textures/entity/boat/sharinga.png"),
new ResourceLocation("rankine:textures/entity/boat/cork_oak.png"),
new ResourceLocation("rankine:textures/entity/boat/cinnamon.png"),
new ResourceLocation("rankine:textures/entity/boat/bamboo.png")
};
protected final BoatModel modelBoat = new BoatModel();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@ public Item getItemBoat() {
return RankineItems.HEMLOCK_BOAT.get();
case MAPLE:
return RankineItems.MAPLE_BOAT.get();
case BLACK_WALNUT:
return RankineItems.BLACK_WALNUT_BOAT.get();
case SHARINGA:
return RankineItems.SHARINGA_BOAT.get();
case CORK_OAK:
return RankineItems.CORK_OAK_BOAT.get();
case CINNAMON:
return RankineItems.CINNAMON_BOAT.get();
case BAMBOO:
return RankineItems.BAMBOO_BOAT.get();
}
Expand Down Expand Up @@ -116,6 +124,10 @@ public enum Type {
MAGNOLIA(RankineBlocks.MAGNOLIA_PLANKS.get(), "magnolia"),
HEMLOCK(RankineBlocks.EASTERN_HEMLOCK_PLANKS.get(), "hemlock"),
MAPLE(RankineBlocks.MAPLE_PLANKS.get(), "maple"),
BLACK_WALNUT(RankineBlocks.BLACK_WALNUT_PLANKS.get(), "black_walnut"),
SHARINGA(RankineBlocks.SHARINGA_PLANKS.get(), "sharinga"),
CORK_OAK(RankineBlocks.CORK_OAK_PLANKS.get(), "cork_oak"),
CINNAMON(RankineBlocks.CINNAMON_PLANKS.get(), "cinnamon"),
BAMBOO(RankineBlocks.BAMBOO_PLANKS.get(), "bamboo");


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -952,16 +952,19 @@ public static void onItemAttributeModification(ItemAttributeModifierEvent event)
event.addModifier(Attributes.ATTACK_SPEED, new AttributeModifier(UUID.fromString("3c4a1c57-ed5a-482e-946e-eb0b00fe5fc2"), "Rankine Attspeed modifier",
alloyTool.getAlloyAttackSpeed(alloyTool.returnCompositionString(stack),alloyTool.returnAlloyUtils()),
AttributeModifier.Operation.ADDITION));
} else if (stack.getItem() instanceof IAlloyArmor && stack.getItem() instanceof ArmorItem && event.getSlotType() == ((ArmorItem)stack.getItem()).getEquipmentSlot())
}

if (stack.getItem() instanceof IAlloyArmor && stack.getItem() instanceof ArmorItem && event.getSlotType() == ((ArmorItem)stack.getItem()).getEquipmentSlot())
{
IAlloyArmor alloyArmor = (IAlloyArmor) stack.getItem();

int slot1 = event.getSlotType().getSlotIndex() * 2;
int slot2 = slot1 + 1;
int tough = alloyArmor.getAlloyArmorToughness(alloyArmor.returnCompositionString(stack),alloyArmor.returnAlloyUtils());
int def = alloyArmor.getAlloyDamageReduceAmount(alloyArmor.returnCompositionString(stack),alloyArmor.returnAlloyUtils(),((ArmorItem)stack.getItem()).getEquipmentSlot());
event.addModifier(Attributes.ARMOR_TOUGHNESS,new AttributeModifier(UUID.fromString("3c4a1c57-ed5a-482e-946e-eb0b00fe1fa1"), "Rankine Armor Toughness modifier",
event.addModifier(Attributes.ARMOR_TOUGHNESS,new AttributeModifier(UUID.fromString("3c4a1c57-ed5a-482e-946e-eb0b00fe1fa"+slot1), "Rankine Armor Toughness modifier",
tough,
AttributeModifier.Operation.ADDITION));
event.addModifier(Attributes.ARMOR, new AttributeModifier(UUID.fromString("3c4a1c57-ed5a-482e-946e-eb0b00fe1fa2"), "Rankine Armor modifier",
event.addModifier(Attributes.ARMOR, new AttributeModifier(UUID.fromString("3c4a1c57-ed5a-482e-946e-eb0b00fe1fa"+slot2), "Rankine Armor modifier",
def,
AttributeModifier.Operation.ADDITION));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1765,8 +1765,11 @@ public class RankineItems {
public static final RegistryObject<Item> MAGNOLIA_BOAT = REGISTRY.register("magnolia_boat", () -> new RankineBoatItem(RankineBoatEntity.Type.MAGNOLIA, new Item.Properties().maxStackSize(1).group(ProjectRankine.setup.rankineTools)));
public static final RegistryObject<Item> HEMLOCK_BOAT = REGISTRY.register("eastern_hemlock_boat", () -> new RankineBoatItem(RankineBoatEntity.Type.HEMLOCK, new Item.Properties().maxStackSize(1).group(ProjectRankine.setup.rankineTools)));
public static final RegistryObject<Item> MAPLE_BOAT = REGISTRY.register("maple_boat", () -> new RankineBoatItem(RankineBoatEntity.Type.MAPLE, new Item.Properties().maxStackSize(1).group(ProjectRankine.setup.rankineTools)));
public static final RegistryObject<Item> BLACK_WALNUT_BOAT = REGISTRY.register("black_walnut_boat", () -> new RankineBoatItem(RankineBoatEntity.Type.BLACK_WALNUT, new Item.Properties().maxStackSize(1).group(ProjectRankine.setup.rankineTools)));
public static final RegistryObject<Item> SHARINGA_BOAT = REGISTRY.register("sharinga_boat", () -> new RankineBoatItem(RankineBoatEntity.Type.SHARINGA, new Item.Properties().maxStackSize(1).group(ProjectRankine.setup.rankineTools)));
public static final RegistryObject<Item> CORK_OAK_BOAT = REGISTRY.register("cork_oak_boat", () -> new RankineBoatItem(RankineBoatEntity.Type.CORK_OAK, new Item.Properties().maxStackSize(1).group(ProjectRankine.setup.rankineTools)));
public static final RegistryObject<Item> CINNAMON_BOAT = REGISTRY.register("cinnamon_boat", () -> new RankineBoatItem(RankineBoatEntity.Type.CINNAMON, new Item.Properties().maxStackSize(1).group(ProjectRankine.setup.rankineTools)));
public static final RegistryObject<Item> BAMBOO_BOAT = REGISTRY.register("bamboo_boat", () -> new RankineBoatItem(RankineBoatEntity.Type.BAMBOO, new Item.Properties().maxStackSize(1).group(ProjectRankine.setup.rankineTools)));

public static final RegistryObject<Item> DRIED_BAMBOO = REGISTRY.register("dried_bamboo", () -> new FuelItem(new Item.Properties().group(ProjectRankine.setup.rankineTools), 50));
public static final RegistryObject<Item> HERBICIDE = REGISTRY.register("herbicide", () -> new HerbicideItem(new Item.Properties().group(ProjectRankine.setup.rankineTools)));
public static final RegistryObject<Item> DRY_RUBBER = REGISTRY.register("dry_rubber", () -> new Item(new Item.Properties().group(ProjectRankine.setup.rankineTools)));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package com.cannolicatfish.rankine.items;

import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemUseContext;
import net.minecraft.item.*;
import net.minecraft.tags.BlockTags;
import net.minecraft.tags.ITag;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.SoundEvents;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraft.util.text.TextFormatting;
Expand All @@ -33,11 +33,14 @@ public ActionResultType onItemUse(ItemUseContext context) {
BlockPos pos = context.getPos();
Block b = worldIn.getBlockState(pos).getBlock();
ITag<Block> tag = BlockTags.getCollection().get(new ResourceLocation("rankine:flowers"));
if (tag != null && b.getTags().contains(new ResourceLocation("forge:dirt")) && worldIn.getBlockState(pos.up()).isAir()) {
if (!worldIn.isRemote && tag != null && b.getTags().contains(new ResourceLocation("forge:dirt")) && worldIn.getBlockState(pos.up()).isAir()) {
Block flower = tag.getRandomElement(worldIn.getRandom());
if (!worldIn.isRemote) {
worldIn.setBlockState(pos.up(), flower.getDefaultState());
worldIn.playSound(context.getPlayer(), pos, SoundEvents.BLOCK_GRASS_PLACE, SoundCategory.BLOCKS, 0.7F, worldIn.getRandom().nextFloat() * 0.4F + 0.5F);
if (Minecraft.getInstance().objectMouseOver != null && context.getPlayer() != null) {
ActionResultType actionresulttype = ((BlockItem) flower.asItem()).tryPlace(new BlockItemUseContext(
new ItemUseContext(context.getWorld(),context.getPlayer(),context.getHand(), context.getItem(),(BlockRayTraceResult) Minecraft.getInstance().objectMouseOver)));
return !actionresulttype.isSuccessOrConsume() && this.isFood() ? this.onItemRightClick(context.getWorld(), context.getPlayer(), context.getHand()).getType() : actionresulttype;
} else {
return ActionResultType.PASS;
}
}

Expand Down
6 changes: 5 additions & 1 deletion src/main/resources/assets/rankine/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,10 @@
"item.rankine.balsam_fir_boat": "Balsam Fir Boat",
"item.rankine.magnolia_boat": "Magnolia Boat",
"item.rankine.maple_boat": "Maple Boat",
"item.rankine.black_walnut_boat": "Black Walnut Boat",
"item.rankine.sharinga_boat": "Sharinga Boat",
"item.rankine.cork_oak_boat": "Cork Oak Boat",
"item.rankine.cinnamon_boat": "Cinnamon Boat",
"item.rankine.coconut": "Coconut",
"item.rankine.pina_colada": "Pina Colada",
"block.rankine.unaged_cheese": "Unaged Cheese",
Expand Down Expand Up @@ -2033,7 +2037,7 @@
"block.rankine.breccia_bricks_pressure_plate": "Breccia Bricks Pressure Plate",
"block.rankine.breccia_button": "Breccia Button",

"item.rankine.netherite_nugget": "Solidified Netherite Nugget",
"item.rankine.netherite_nugget": "Netherite Nugget",
"item.rankine.hydrogen_nugget": "Solidified Hydrogen Nugget",
"item.rankine.helium_nugget": "Solidified Helium Nugget",
"item.rankine.lithium_nugget": "Lithium Nugget",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "rankine:item/black_walnut_boat"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "rankine:item/cinnamon_boat"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "rankine:item/cork_oak_boat"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "rankine:item/sharinga_boat"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"pages": [
{
"type": "text",
"text": ""
"text": "Rubber is an elastic material used for various purposes."
},
{
"type": "spotlight",
Expand All @@ -17,6 +17,11 @@
"type": "crafting",
"recipe": "rankine:vulcanized_rubber",
"text": "A more elastic form of rubber that can be used to craft certain components."
},
{
"type": "crafting",
"recipe": "rankine:vulcanized_rubber_sodium_sulfide",
"text": "An alternative crafting method which produces more Vulcanized Rubber by using Sodium Sulfide."
}
]
}
17 changes: 17 additions & 0 deletions src/main/resources/data/rankine/recipes/black_birch_boat.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
" ",
"# #",
"###"
],
"key": {
"#": {
"item": "rankine:black_birch_planks"
}
},
"result": {
"item": "minecraft:birch_boat",
"count": 1
}
}
17 changes: 17 additions & 0 deletions src/main/resources/data/rankine/recipes/black_walnut_boat.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
" ",
"# #",
"###"
],
"key": {
"#": {
"item": "rankine:black_walnut_planks"
}
},
"result": {
"item": "rankine:black_walnut_boat",
"count": 1
}
}
17 changes: 17 additions & 0 deletions src/main/resources/data/rankine/recipes/cinnamon_boat.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
" ",
"# #",
"###"
],
"key": {
"#": {
"item": "rankine:cinnamon_planks"
}
},
"result": {
"item": "rankine:cinnamon_boat",
"count": 1
}
}
17 changes: 17 additions & 0 deletions src/main/resources/data/rankine/recipes/cork_oak_boat.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
" ",
"# #",
"###"
],
"key": {
"#": {
"item": "rankine:cork_oak_planks"
}
},
"result": {
"item": "rankine:cork_oak_boat",
"count": 1
}
}
17 changes: 17 additions & 0 deletions src/main/resources/data/rankine/recipes/maple_boat.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
" ",
"# #",
"###"
],
"key": {
"#": {
"item": "rankine:maple_planks"
}
},
"result": {
"item": "rankine:maple_boat",
"count": 1
}
}
17 changes: 17 additions & 0 deletions src/main/resources/data/rankine/recipes/sharinga_boat.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
" ",
"# #",
"###"
],
"key": {
"#": {
"item": "rankine:sharinga_planks"
}
},
"result": {
"item": "rankine:sharinga_boat",
"count": 1
}
}
24 changes: 24 additions & 0 deletions src/main/resources/data/rankine/recipes/steel_arrow.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"type": "rankine:alloy_crafting",
"inherit": "true",
"pattern": [
"X",
"#",
"Y"
],
"key": {
"#": {
"tag": "forge:rods/wooden"
},
"X": {
"item": "rankine:steel_alloy"
},
"Y": {
"item": "minecraft:feather"
}
},
"result": {
"item": "rankine:alloy_arrow",
"count": 4
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"item": "rankine:dry_rubber"
},
{
"item": "minecraft:bone_meal"
},
{
"item": "rankine:sodium_sulfide"
},
{
"tag": "forge:nuggets/carbon"
}
],
"result": {
"item": "rankine:vulcanized_rubber",
"count": 2
}
}
17 changes: 17 additions & 0 deletions src/main/resources/data/rankine/recipes/yellow_birch_boat.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
" ",
"# #",
"###"
],
"key": {
"#": {
"item": "rankine:yellow_birch_planks"
}
},
"result": {
"item": "minecraft:birch_boat",
"count": 1
}
}

0 comments on commit e6350c5

Please sign in to comment.