Skip to content

Commit

Permalink
SA
Browse files Browse the repository at this point in the history
  • Loading branch information
chochem committed Feb 1, 2023
1 parent 29b6a51 commit 32dc71f
Show file tree
Hide file tree
Showing 68 changed files with 6,094 additions and 6,046 deletions.
6 changes: 1 addition & 5 deletions src/main/java/taintedmagic/api/IBloodlust.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
package taintedmagic.api;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;

/**
* Interface implemented by Bloodlust weapons
*/
public interface IBloodlust
{
public interface IBloodlust {
}
98 changes: 49 additions & 49 deletions src/main/java/taintedmagic/api/RecipeVoidsentBlood.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;

import taintedmagic.common.items.ItemVoidsentBlood;
import thaumcraft.common.items.armor.ItemCultistLeaderArmor;
import thaumcraft.common.items.armor.ItemCultistPlateArmor;
Expand All @@ -14,59 +14,59 @@
/**
* Custom recipe for aplpying Voidsent Blood to Cult Attire
*/
public class RecipeVoidsentBlood implements IRecipe
{
@Override
public boolean matches (InventoryCrafting inv, World w)
{
boolean foundBlood = false;
boolean foundArmor = false;
public class RecipeVoidsentBlood implements IRecipe {

@Override
public boolean matches(InventoryCrafting inv, World w) {
boolean foundBlood = false;
boolean foundArmor = false;

for (int i = 0; i < inv.getSizeInventory(); i++)
{
ItemStack s = inv.getStackInSlot(i);
for (int i = 0; i < inv.getSizeInventory(); i++) {
ItemStack s = inv.getStackInSlot(i);

if (s != null)
{
if (s.getItem() instanceof ItemVoidsentBlood && !foundBlood) foundBlood = true;
else if ( (s.getItem() instanceof ItemCultistRobeArmor || s.getItem() instanceof ItemCultistPlateArmor || s.getItem() instanceof ItemCultistLeaderArmor) && !foundArmor) foundArmor = true;
if (s != null) {
if (s.getItem() instanceof ItemVoidsentBlood && !foundBlood) foundBlood = true;
else if ((s.getItem() instanceof ItemCultistRobeArmor || s.getItem() instanceof ItemCultistPlateArmor
|| s.getItem() instanceof ItemCultistLeaderArmor) && !foundArmor)
foundArmor = true;

else return false;
}
}
return foundBlood && foundArmor;
}
else return false;
}
}
return foundBlood && foundArmor;
}

@Override
public ItemStack getCraftingResult (InventoryCrafting inv)
{
ItemStack copy = null;
ItemStack armor = null;
ItemStack blood = null;
@Override
public ItemStack getCraftingResult(InventoryCrafting inv) {
ItemStack copy = null;
ItemStack armor = null;
ItemStack blood = null;

for (int i = 0; i < inv.getSizeInventory(); i++)
{
if (inv.getStackInSlot(i) != null && (inv.getStackInSlot(i).getItem() instanceof ItemCultistRobeArmor || inv.getStackInSlot(i).getItem() instanceof ItemCultistPlateArmor || inv.getStackInSlot(i).getItem() instanceof ItemCultistLeaderArmor)) armor = inv.getStackInSlot(i);
else if (inv.getStackInSlot(i) != null && inv.getStackInSlot(i).getItem() instanceof ItemVoidsentBlood) blood = inv.getStackInSlot(i);
}
if (armor != null && blood != null && (armor.getTagCompound() == null || (armor.getTagCompound() != null && !armor.getTagCompound().getBoolean("voidtouched"))))
{
copy = armor.copy();
if (copy.getTagCompound() == null) copy.setTagCompound(new NBTTagCompound());
if (copy.getTagCompound() != null) copy.getTagCompound().setBoolean("voidtouched", true);
}
return copy;
}
for (int i = 0; i < inv.getSizeInventory(); i++) {
if (inv.getStackInSlot(i) != null && (inv.getStackInSlot(i).getItem() instanceof ItemCultistRobeArmor
|| inv.getStackInSlot(i).getItem() instanceof ItemCultistPlateArmor
|| inv.getStackInSlot(i).getItem() instanceof ItemCultistLeaderArmor))
armor = inv.getStackInSlot(i);
else if (inv.getStackInSlot(i) != null && inv.getStackInSlot(i).getItem() instanceof ItemVoidsentBlood)
blood = inv.getStackInSlot(i);
}
if (armor != null && blood != null
&& (armor.getTagCompound() == null
|| (armor.getTagCompound() != null && !armor.getTagCompound().getBoolean("voidtouched")))) {
copy = armor.copy();
if (copy.getTagCompound() == null) copy.setTagCompound(new NBTTagCompound());
if (copy.getTagCompound() != null) copy.getTagCompound().setBoolean("voidtouched", true);
}
return copy;
}

@Override
public int getRecipeSize ()
{
return 10;
}
@Override
public int getRecipeSize() {
return 10;
}

@Override
public ItemStack getRecipeOutput ()
{
return null;
}
@Override
public ItemStack getRecipeOutput() {
return null;
}
}
101 changes: 50 additions & 51 deletions src/main/java/taintedmagic/client/ClientProxy.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package taintedmagic.client;

import java.util.Random;

import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.common.MinecraftForge;

import taintedmagic.client.handler.HUDHandler;
import taintedmagic.client.renderer.RenderEntityHomingShard;
import taintedmagic.client.renderer.RenderEntityTaintBubble;
Expand All @@ -23,63 +21,64 @@
import thaumcraft.client.renderers.entity.RenderEldritchOrb;
import thaumcraft.codechicken.lib.vec.Vector3;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.relauncher.ReflectionHelper;

public class ClientProxy extends CommonProxy
{
@Override
public void initRenders ()
{
// Entities
RenderingRegistry.registerEntityRenderingHandler(EntityTaintBubble.class, new RenderEntityTaintBubble());
RenderingRegistry.registerEntityRenderingHandler(EntityEldritchOrbAttack.class, new RenderEldritchOrb());
RenderingRegistry.registerEntityRenderingHandler(EntityHomingShard.class, new RenderEntityHomingShard());
public class ClientProxy extends CommonProxy {

@Override
public void initRenders() {
// Entities
RenderingRegistry.registerEntityRenderingHandler(EntityTaintBubble.class, new RenderEntityTaintBubble());
RenderingRegistry.registerEntityRenderingHandler(EntityEldritchOrbAttack.class, new RenderEldritchOrb());
RenderingRegistry.registerEntityRenderingHandler(EntityHomingShard.class, new RenderEntityHomingShard());

// Items
MinecraftForgeClient.registerItemRenderer(ItemRegistry.ItemKatana, new RenderItemKatana());
}
// Items
MinecraftForgeClient.registerItemRenderer(ItemRegistry.ItemKatana, new RenderItemKatana());
}

@Override
public EntityPlayer getClientPlayer ()
{
return Minecraft.getMinecraft().thePlayer;
}
@Override
public EntityPlayer getClientPlayer() {
return Minecraft.getMinecraft().thePlayer;
}

@Override
public void registerClientHandlers ()
{
MinecraftForge.EVENT_BUS.register(new HUDHandler());
}
@Override
public void registerClientHandlers() {
MinecraftForge.EVENT_BUS.register(new HUDHandler());
}

@Override
public void spawnShockwaveParticles (World w)
{
EntityPlayer p = getClientPlayer();
@Override
public void spawnShockwaveParticles(World w) {
EntityPlayer p = getClientPlayer();

double xp = 0;
double zp = 0;
double xp = 0;
double zp = 0;

for (int i = 1; i < 360; i++)
{
for (int j = 0; j < 5; j++)
{
xp = (Math.cos(i * Math.PI / 180F));
zp = (Math.sin(i * Math.PI / 180F));
for (int i = 1; i < 360; i++) {
for (int j = 0; j < 5; j++) {
xp = (Math.cos(i * Math.PI / 180F));
zp = (Math.sin(i * Math.PI / 180F));

float red = (0.05F + p.worldObj.rand.nextFloat() * 0.1F);
float blue = (0.1F + p.worldObj.rand.nextFloat() * 0.1F);
float red = (0.05F + p.worldObj.rand.nextFloat() * 0.1F);
float blue = (0.1F + p.worldObj.rand.nextFloat() * 0.1F);

double off = Math.random() * 0.1;
double off = Math.random() * 0.1;

FXWisp ef = new FXWisp(w, p.posX + xp + off, p.posY - 1, p.posZ + zp + off, 2.0F * (float) Math.random(), red, 0.0F, blue);
ef.setGravity(0.0F);
ef.shrink = true;
ef.noClip = true;
Vector3 movement = TaintedMagicHelper.getDistanceBetween(ef, p);
ef.addVelocity(movement.x * 2.5, 0, movement.z * 2.5);
FXWisp ef = new FXWisp(
w,
p.posX + xp + off,
p.posY - 1,
p.posZ + zp + off,
2.0F * (float) Math.random(),
red,
0.0F,
blue);
ef.setGravity(0.0F);
ef.shrink = true;
ef.noClip = true;
Vector3 movement = TaintedMagicHelper.getDistanceBetween(ef, p);
ef.addVelocity(movement.x * 2.5, 0, movement.z * 2.5);

ParticleEngine.instance.addEffect(w, ef);
}
}
}
ParticleEngine.instance.addEffect(w, ef);
}
}
}
}
34 changes: 16 additions & 18 deletions src/main/java/taintedmagic/client/handler/HUDHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,25 @@
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;

import taintedmagic.common.items.tools.ItemKatana;
import taintedmagic.common.items.tools.ItemThaumicDisassembler;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;

public class HUDHandler
{
@SubscribeEvent
public void onDrawScreen (RenderGameOverlayEvent.Post event)
{
if (event.type == ElementType.ALL)
{
Minecraft mc = Minecraft.getMinecraft();
EntityPlayer p = mc.thePlayer;
ScaledResolution r = event.resolution;
float pt = event.partialTicks;
public class HUDHandler {

@SubscribeEvent
public void onDrawScreen(RenderGameOverlayEvent.Post event) {
if (event.type == ElementType.ALL) {
Minecraft mc = Minecraft.getMinecraft();
EntityPlayer p = mc.thePlayer;
ScaledResolution r = event.resolution;
float pt = event.partialTicks;

if (mc.currentScreen == null)
{
ItemKatana.renderHUD(r, p, pt);
ItemThaumicDisassembler.renderHUD(r, p, pt);
}
}
}
if (mc.currentScreen == null) {
ItemKatana.renderHUD(r, p, pt);
ItemThaumicDisassembler.renderHUD(r, p, pt);
}
}
}
}
67 changes: 31 additions & 36 deletions src/main/java/taintedmagic/client/model/ModelKatana.java
Original file line number Diff line number Diff line change
@@ -1,48 +1,43 @@
package taintedmagic.client.model;

import org.lwjgl.opengl.GL11;

import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;

/**
* katana - wiiv Created using Tabula 4.1.1
*/
public class ModelKatana extends ModelBase
{
public ModelRenderer blade;
public ModelRenderer grip1;
public ModelRenderer grip2;
public class ModelKatana extends ModelBase {

public ModelRenderer blade;
public ModelRenderer grip1;
public ModelRenderer grip2;

public ModelKatana ()
{
this.textureWidth = 32;
this.textureHeight = 64;
this.grip2 = new ModelRenderer(this, 22, 0);
this.grip2.setRotationPoint(0.0F, 0.0F, 0.0F);
this.grip2.addBox(-1.0F, -12.0F, -1.5F, 2, 12, 3, 0.0F);
this.blade = new ModelRenderer(this, 0, 0);
this.blade.setRotationPoint(0.0F, -40.0F, 0.0F);
this.blade.addBox(-0.5F, 0.0F, -2.0F, 1, 48, 4, -0.75F);
this.grip1 = new ModelRenderer(this, 0, 52);
this.grip1.setRotationPoint(0.0F, -40.0F, 0.0F);
this.grip1.addBox(-2.5F, 0.0F, -3.5F, 5, 1, 7, 0.0F);
this.grip1.addChild(this.grip2);
}
public ModelKatana() {
this.textureWidth = 32;
this.textureHeight = 64;
this.grip2 = new ModelRenderer(this, 22, 0);
this.grip2.setRotationPoint(0.0F, 0.0F, 0.0F);
this.grip2.addBox(-1.0F, -12.0F, -1.5F, 2, 12, 3, 0.0F);
this.blade = new ModelRenderer(this, 0, 0);
this.blade.setRotationPoint(0.0F, -40.0F, 0.0F);
this.blade.addBox(-0.5F, 0.0F, -2.0F, 1, 48, 4, -0.75F);
this.grip1 = new ModelRenderer(this, 0, 52);
this.grip1.setRotationPoint(0.0F, -40.0F, 0.0F);
this.grip1.addBox(-2.5F, 0.0F, -3.5F, 5, 1, 7, 0.0F);
this.grip1.addChild(this.grip2);
}

public void render (float size)
{
this.blade.render(size);
this.grip1.render(size);
}
public void render(float size) {
this.blade.render(size);
this.grip1.render(size);
}

/**
* This is a helper function from Tabula to set the rotation of model parts
*/
private void setRotation (ModelRenderer m, float x, float y, float z)
{
m.rotateAngleX = x;
m.rotateAngleY = y;
m.rotateAngleZ = z;
}
/**
* This is a helper function from Tabula to set the rotation of model parts
*/
private void setRotation(ModelRenderer m, float x, float y, float z) {
m.rotateAngleX = x;
m.rotateAngleY = y;
m.rotateAngleZ = z;
}
}
Loading

0 comments on commit 32dc71f

Please sign in to comment.