-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some code improvements, bug fixes, plus other things I think?
- Loading branch information
Showing
30 changed files
with
754 additions
and
253 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/main/java/llc/redstone/hysentials/cosmetics/Cosmetic.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package llc.redstone.hysentials.cosmetics; | ||
|
||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.model.ModelBase; | ||
import net.minecraft.client.renderer.GlStateManager; | ||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.util.ResourceLocation; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public interface Cosmetic { | ||
boolean canUse(EntityPlayer player); | ||
ModelBase getModel(); | ||
ResourceLocation getTexture(); | ||
String getName(); | ||
|
||
default void renderPreview(int x, int y, int ticks) { | ||
EntityPlayer player = Minecraft.getMinecraft().thePlayer; | ||
if (!canUse(player)) return; | ||
Minecraft.getMinecraft().getTextureManager().bindTexture(getTexture()); | ||
GlStateManager.pushMatrix(); | ||
|
||
GlStateManager.rotate(toRadians(ticks /20f), 0f, 1.0F, 0.0F); | ||
// GlStateManager.translate(x, y, 0); | ||
float n = 1; | ||
GlStateManager.scale(n, n, n); | ||
|
||
getModel().render(player, 0, 0, 0, 0, 0, n); | ||
|
||
GlStateManager.popMatrix(); | ||
} | ||
|
||
default float toRadians(float degrees) { | ||
return (float) (degrees * (Math.PI / 180)); | ||
} | ||
} |
28 changes: 24 additions & 4 deletions
28
src/main/java/llc/redstone/hysentials/cosmetics/backpack/BackpackCosmetic.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 21 additions & 4 deletions
25
src/main/java/llc/redstone/hysentials/cosmetics/hats/blackcat/BlackCat.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,34 @@ | ||
package llc.redstone.hysentials.cosmetics.hats.blackcat; | ||
|
||
import llc.redstone.hysentials.cosmetic.CosmeticGui; | ||
import llc.redstone.hysentials.cosmetic.CosmeticUtilsKt; | ||
import llc.redstone.hysentials.cosmetic.CosmeticManager; | ||
import llc.redstone.hysentials.cosmetics.AbstractCosmetic; | ||
import llc.redstone.hysentials.cosmetics.Cosmetic; | ||
import llc.redstone.hysentials.cosmetics.hats.technocrown.TechnoCrownModel; | ||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.util.ResourceLocation; | ||
|
||
public class BlackCat { | ||
public class BlackCat implements Cosmetic { | ||
BlackCatModel model; | ||
public BlackCat() { | ||
model = new BlackCatModel(); | ||
AbstractCosmetic.cosmetics.add(this); | ||
} | ||
public boolean canUse(EntityPlayer player) { | ||
return CosmeticUtilsKt.equippedCosmetic(player.getUniqueID(), "black cat") | ||
&& CosmeticUtilsKt.hasCosmetic(player.getUniqueID(), "black cat"); | ||
return CosmeticManager.equippedCosmetic(player.getUniqueID(), "black cat") | ||
&& CosmeticManager.hasCosmetic(player.getUniqueID(), "black cat"); | ||
} | ||
|
||
public BlackCatModel getModel() { | ||
return model; | ||
} | ||
|
||
public ResourceLocation getTexture() { | ||
return new ResourceLocation("hysentials:hats/blackcat.png"); | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return "black cat"; | ||
} | ||
} |
Oops, something went wrong.