Skip to content

Commit

Permalink
Added a new variant of thigh highs.
Browse files Browse the repository at this point in the history
  • Loading branch information
misterghast committed May 26, 2022
1 parent f2fe151 commit 171032f
Show file tree
Hide file tree
Showing 15 changed files with 113 additions and 27 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
buildscript {
repositories {
maven {
url = 'https://files.minecrafforge.net/maven'
url = 'https://files.minecraftforge.net/maven'
}
maven {
url = 'https://repo.spongepowered.org/maven'
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
org.gradle.jvmargs = -Xmx3G

# Mod Information
mod_version = 1.0
maven_group = com.cleanroommc
archives_base_name = modid
mod_version = 0.7
maven_group = org.hypbase
archives_base_name = owo

# If any properties changes below this line, run `gradlew setupDecompWorkspace` and refresh gradle again to ensure everything is working correctly.

Expand Down
7 changes: 7 additions & 0 deletions src/main/java/org/hypbase/owo/OwO.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import net.minecraftforge.common.capabilities.CapabilityManager;
import net.minecraftforge.common.config.Config;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.relauncher.Side;
import org.hypbase.owo.capabilities.DefaultEuphoriaCapability;
Expand All @@ -18,6 +19,8 @@
@Mod(modid="owo", name="Leggings of Euphoria", version="0.4", useMetadata=false)
public class OwO {

//@SidedProxy(modId="owo", clientSide="OwOEvents",serverSide="OwOServerEvents")
//public static OwOServerEvents proxy;
@Config(modid="owo", name="Leggings of Euphoria Config", type= Config.Type.INSTANCE, category="general")
public static class OwOConfig {
public static int ARMOR_VALUE = 0;
Expand All @@ -31,8 +34,12 @@ public static class OwOConfig {
public void preInit(FMLPreInitializationEvent event) {

MinecraftForge.EVENT_BUS.register(events);
//MinecraftForge.EVENT_BUS.register(proxy);
CapabilityManager.INSTANCE.register(EuphoriaCapability.class, new EuphoriaStorage(), new EuphoriaFactory());
OwOPacketHandler.INSTANCE.registerMessage(SyncEuphoriaHandler.class, SyncEuphoriaMessage.class, 0, Side.CLIENT);



}
}

Expand Down
11 changes: 11 additions & 0 deletions src/main/java/org/hypbase/owo/OwOClientEvents.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package org.hypbase.owo;

import net.minecraftforge.client.event.RenderTooltipEvent;
import net.minecraftforge.fml.common.Mod;

@Mod.EventBusSubscriber
public class OwOClientEvents {
public void renderItemTooltip(RenderTooltipEvent event) {

}
}
19 changes: 11 additions & 8 deletions src/main/java/org/hypbase/owo/OwOEvents.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package org.hypbase.owo;

import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumHand;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.client.event.ModelRegistryEvent;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.common.ISpecialArmor;
Expand All @@ -32,23 +34,23 @@ public class OwOEvents {
@GameRegistry.ObjectHolder("owo:owolegs")
public static final OwOArmorItem owolegs = null;

@GameRegistry.ObjectHolder("owo:owolegs1")
public static final OwOArmorItem owolegs1 = null;
@GameRegistry.ObjectHolder("owo:owolegsbw")
public static final OwOArmorItem owolegsbw = null;

@SubscribeEvent
public void registerItems(RegistryEvent.Register<Item> event) {
OwOArmorItem owolegs = new OwOArmorItem(OwOItems.Tier1OwO, EntityEquipmentSlot.LEGS);
OwOArmorItem owolegs = new OwOArmorItem(OwOItems.Tier1OwO, EntityEquipmentSlot.LEGS, "trans");
owolegs.setRegistryName(new ResourceLocation(OwO.MOD_ID, "owolegs"));
owolegs.setTranslationKey(OwO.MOD_ID + "." + "owolegs");

OwOArmorItem owolegs1 = new OwOArmorItem(OwOItems.Tier2OwO, EntityEquipmentSlot.LEGS);
owolegs1.setRegistryName(new ResourceLocation(OwO.MOD_ID, "owolegs1"));
owolegs1.setTranslationKey(OwO.MOD_ID + "." + "owolegs1");
OwOArmorItem owolegsbw = new OwOArmorItem(OwOItems.Tier1OwO, EntityEquipmentSlot.LEGS, "bw");
owolegsbw.setRegistryName(new ResourceLocation(OwO.MOD_ID, "owolegsbw"));
owolegsbw.setTranslationKey(OwO.MOD_ID + "." + "owolegs");



event.getRegistry().register(owolegs);
event.getRegistry().register(owolegs1);
event.getRegistry().register(owolegsbw);
for(Map.Entry<ResourceLocation, Item> entry : event.getRegistry().getEntries()) {
System.out.println(entry.getKey().toString());
}
Expand All @@ -57,10 +59,11 @@ public void registerItems(RegistryEvent.Register<Item> event) {
@SubscribeEvent
public void modelRegistry(ModelRegistryEvent event) {
ModelLoader.setCustomModelResourceLocation(owolegs, 0, new ModelResourceLocation("owo:owolegs", "inventory"));
ModelLoader.setCustomModelResourceLocation(owolegs1, 0, new ModelResourceLocation("owo:owolegs", "inventory"));
ModelLoader.setCustomModelResourceLocation(owolegsbw, 0, new ModelResourceLocation("owo:owolegsbw", "inventory"));
}



//For testing.
/*@SubscribeEvent
public void blockBroken(BlockEvent.BreakEvent event) {
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/hypbase/owo/OwOServerEvents.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package org.hypbase.owo;

public class OwOServerEvents {
}
20 changes: 8 additions & 12 deletions src/main/java/org/hypbase/owo/armor/OwOArmorItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
Expand All @@ -13,7 +14,8 @@
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.text.translation.I18n;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.common.ISpecialArmor;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.ICapabilityProvider;
Expand All @@ -37,17 +39,17 @@
public class OwOArmorItem extends ItemArmor {

private static final UUID[] ARMOR_MODIFIERS = new UUID[] {UUID.fromString("845DB27C-C624-495F-8C9F-6020A9A58B6B"), UUID.fromString("D8499B04-0E66-4726-AB29-64469D734E0D"), UUID.fromString("9F3D476D-C118-4544-8365-64846904B48E"), UUID.fromString("2AD3F246-FEE1-4E67-B886-69FD380BB150")};
private String variant;


public OwOArmorItem(ArmorMaterial materialIn, EntityEquipmentSlot equipmentSlotIn) {
public OwOArmorItem(ArmorMaterial materialIn, EntityEquipmentSlot equipmentSlotIn, String variant) {
super(materialIn, 0, equipmentSlotIn);

this.variant = variant;
}

@Override
public String getArmorTexture(ItemStack itemstack, Entity entity, EntityEquipmentSlot slot, String layer) {
if (slot == EntityEquipmentSlot.LEGS) {
return OwO.MOD_ID + ":textures/armor/" + "owo_2" + ".png";
return OwO.MOD_ID + ":textures/armor/" + "owo_2" + "_" + this.variant + ".png";
} else {
return OwO.MOD_ID + ":textures/armor/" + "owo_1" + ".png";
}
Expand All @@ -61,13 +63,7 @@ public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemSta

@Override
public String getItemStackDisplayName(ItemStack stack) {
String r = super.getItemStackDisplayName(stack);
//if(stack.hasCapability(EuphoriaProvider.EUPHORIA_CAPABILITY, null)) {
//return "§b" + r + "§r" + " +" + stack.getCapability(EuphoriaProvider.EUPHORIA_CAPABILITY, null).getLevel();
//} else {
return "§b" + r + "§r";
//}

return I18n.format(this.getTranslationKey(), TextFormatting.AQUA, TextFormatting.RESET);
}

@Override
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/org/hypbase/owo/armor/OwOItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import org.hypbase.owo.OwO;

public class OwOItems {
public static ItemArmor.ArmorMaterial Tier1OwO = EnumHelper.addArmorMaterial("owo", "owo", 80, new int[]{5, OwO.OwOConfig.ARMOR_VALUE, 5, 5}, 28, SoundEvents.ITEM_ARMOR_EQUIP_LEATHER, OwO.OwOConfig.ARMOR_TOUGHNESS);
public static ItemArmor.ArmorMaterial Tier2OwO = EnumHelper.addArmorMaterial("owo1", "owo", 160, new int[]{5, 8, 5, 5}, 28, SoundEvents.ITEM_ARMOR_EQUIP_LEATHER, 0.3F);
public static ItemArmor.ArmorMaterial Tier1OwO = EnumHelper.addArmorMaterial("owo", "owo", 80, new int[]{5, OwO.OwOConfig.ARMOR_VALUE, 5, 5}, 28, null, OwO.OwOConfig.ARMOR_TOUGHNESS);

}
2 changes: 1 addition & 1 deletion src/main/resources/assets/owo/lang/en_us.lang
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
item.owo.owolegs.name=Leggings of Euphoria
item.owo.owolegs=%1$sLeggings of Euphoria%2$s
item.owo.owolegs1.name=Leggings of Euphoria +1
item.owo.owolegs2.name=Leggings of Euphoria +2
item.owo.owolegs3.name=Leggings of Euphoria +3
Expand Down
60 changes: 60 additions & 0 deletions src/main/resources/assets/owo/models/item/owolegsbw.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"credit": "Made with Blockbench",
"textures": {
"1": "owo:item/bw_item",
"particle": "owo:item/bw_item"
},
"elements": [
{
"name": "Right Leg Armor",
"from": [8.4, -2.5, 5.5],
"to": [13.4, 10.5, 10.5],
"rotation": {"angle": 0, "axis": "y", "origin": [-7, 6, -8]},
"faces": {
"north": {"uv": [4, 4, 8, 16], "texture": "#1"},
"east": {"uv": [0, 4, 4, 16], "texture": "#1"},
"south": {"uv": [12, 4, 16, 16], "texture": "#1"},
"west": {"uv": [8, 4, 12, 16], "texture": "#1"},
"up": {"uv": [8, 4, 4, 0], "texture": "#1"},
"down": {"uv": [12, 0, 8, 4], "texture": "#1"}
}
},
{
"name": "Left Leg Armor",
"from": [3.6, 3.5, 3.5],
"to": [8.6, 16.5, 8.5],
"rotation": {"angle": 22.5, "axis": "x", "origin": [-7, 6, -8]},
"faces": {
"north": {"uv": [4, 4, 8, 16], "texture": "#1"},
"east": {"uv": [0, 4, 4, 16], "texture": "#1"},
"south": {"uv": [12, 4, 16, 16], "texture": "#1"},
"west": {"uv": [8, 4, 12, 16], "texture": "#1"},
"up": {"uv": [8, 4, 4, 0], "texture": "#1"},
"down": {"uv": [12, 0, 8, 4], "texture": "#1"}
}
}
],
"display": {
"thirdperson_righthand": {
"translation": [0, 3.75, 0]
},
"gui": {
"rotation": [0, -138, 0],
"translation": [0, 3, 0]
}
},
"groups": [
{
"name": "RightLeg",
"origin": [1.9, 12, 0],
"color": 0,
"children": [0]
},
{
"name": "LeftLeg",
"origin": [-1.9, 12, 0],
"color": 0,
"children": [1]
}
]
}
6 changes: 6 additions & 0 deletions src/main/resources/assets/owo/models/item/owolegsbwb.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "owo:armor_leggings_bw"
}
}
Binary file modified src/main/resources/assets/owo/textures/armor/owo_1.png
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.

0 comments on commit 171032f

Please sign in to comment.