generated from Turnip-Labs/bta-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
223 additions
and
23 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
16 changes: 16 additions & 0 deletions
16
src/main/java/baguchan/better_with_aquatic/compat/SpawnEggCompat.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,16 @@ | ||
package baguchan.better_with_aquatic.compat; | ||
|
||
import baguchan.better_with_aquatic.BetterWithAquatic; | ||
import baguchan.better_with_aquatic.util.IDUtils; | ||
import turniplabs.halplibe.helper.ItemHelper; | ||
import useless.spawneggs.ItemSpawnEgg; | ||
|
||
public class SpawnEggCompat { | ||
|
||
public static void onInitialize() { | ||
ItemHelper.createItem(BetterWithAquatic.MOD_ID, new ItemSpawnEgg("spawn.egg.fish", ItemHelper.findOpenIds(IDUtils.getCurrItemId()), | ||
"Fish", 0x6B9F93, 0xADBEDB), "spawnegg.fish", "spawnEggDefault.png"); | ||
ItemHelper.createItem(BetterWithAquatic.MOD_ID, new ItemSpawnEgg("spawn.egg.angler_fish", ItemHelper.findOpenIds(IDUtils.getCurrItemId()), | ||
"AnglerFish", 0x7B3E3E, 0x3D1818), "spawnegg.angler_fish", "spawnEggDefault.png"); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/baguchan/better_with_aquatic/entity/EntityAnglerFish.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,30 @@ | ||
package baguchan.better_with_aquatic.entity; | ||
|
||
import net.minecraft.core.world.World; | ||
|
||
public class EntityAnglerFish extends EntityBaseFish { | ||
public EntityAnglerFish(World world) { | ||
super(world); | ||
this.highestSkinVariant = -1; | ||
this.setSize(0.5F, 0.45F); | ||
this.setPos(this.x, this.y, this.z); | ||
|
||
this.skinName = "angler_fish"; | ||
} | ||
|
||
@Override | ||
public String getEntityTexture() { | ||
return "/assets/better_with_aquatic/entity/angler_fish.png"; | ||
} | ||
|
||
@Override | ||
public String getDefaultEntityTexture() { | ||
return "/assets/better_with_aquatic/entity/angler_fish.png"; | ||
} | ||
|
||
|
||
@Override | ||
protected float getBlockPathWeight(int x, int y, int z) { | ||
return 0.5f - this.world.getLightBrightness(x, y, z); | ||
} | ||
} |
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
32 changes: 32 additions & 0 deletions
32
src/main/java/baguchan/better_with_aquatic/entity/EntityFish.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,32 @@ | ||
package baguchan.better_with_aquatic.entity; | ||
|
||
import net.minecraft.core.item.Item; | ||
import net.minecraft.core.item.ItemStack; | ||
import net.minecraft.core.world.World; | ||
|
||
public class EntityFish extends EntityBaseFish { | ||
public EntityFish(World world) { | ||
super(world); | ||
this.highestSkinVariant = -1; | ||
this.setSize(0.45F, 0.45F); | ||
this.setPos(this.x, this.y, this.z); | ||
|
||
this.skinName = "fish"; | ||
} | ||
|
||
@Override | ||
public String getEntityTexture() { | ||
return "/assets/better_with_aquatic/entity/fish.png"; | ||
} | ||
|
||
@Override | ||
public String getDefaultEntityTexture() { | ||
return "/assets/better_with_aquatic/entity/fish.png"; | ||
} | ||
|
||
@Override | ||
protected void dropFewItems() { | ||
this.spawnAtLocation(new ItemStack(Item.foodFishRaw, 1, 0), 0.0f); | ||
} | ||
|
||
} |
82 changes: 82 additions & 0 deletions
82
src/main/java/baguchan/better_with_aquatic/entity/render/AnglerFishModel.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,82 @@ | ||
package baguchan.better_with_aquatic.entity.render;// Made with Blockbench 4.8.3 | ||
// Exported for Minecraft version 1.7 - 1.12 | ||
// Paste this class into your mod and generate all required imports | ||
|
||
|
||
import net.minecraft.client.render.model.Cube; | ||
import net.minecraft.client.render.model.ModelBase; | ||
import net.minecraft.core.util.helper.MathHelper; | ||
|
||
public class AnglerFishModel extends ModelBase { | ||
private Cube fish; | ||
private Cube tail; | ||
private Cube fin_r; | ||
private Cube fin_l; | ||
private Cube mouth_down; | ||
private Cube mouth_up; | ||
private Cube things; | ||
private Cube orb; | ||
|
||
public AnglerFishModel() { | ||
fish = new Cube(0, 0); | ||
fish.setRotationPoint(0.0F, 22.0F, 6.0F); | ||
fish.addBox(-3.0F, -5.0F, -9.0F, 6, 7, 9, 0.0F, false); | ||
|
||
tail = new Cube(10, 23); | ||
tail.setRotationPoint(0.0F, 22.0F, 6.0F); | ||
tail.addBox(-1.0F, -3.0F, 0.0F, 2, 5, 4, 0.0F, false); | ||
|
||
fin_r = new Cube(0, 25); | ||
fin_r.setRotationPoint(-3.0F, 22.5F, -3.0F); | ||
fin_r.addBox(-1.0F, -1.5F, 0.0F, 1, 3, 4, 0.0F, false); | ||
|
||
fin_l = new Cube(0, 25); | ||
fin_l.setRotationPoint(3.0F, 22.5F, -1.0F); | ||
fin_l.addBox(0.0F, -1.5F, 0.0F, 1, 3, 4, 0.0F, true); | ||
|
||
mouth_down = new Cube(30, 9); | ||
mouth_down.setRotationPoint(0.0F, 22.0F, -3.0F); | ||
mouth_down.addBox(-3.5F, 0.0F, -4.0F, 7, 2, 4, 0.0F, false); | ||
|
||
mouth_up = new Cube(21, 0); | ||
mouth_up.setRotationPoint(0.0F, 22.0F, -3.0F); | ||
mouth_up.addBox(-3.0F, -5.0F, -4.0F, 6, 5, 4, 0.0F, false); | ||
|
||
things = new Cube(41, 1); | ||
things.setRotationPoint(0.0F, 22.0F, -3.0F); | ||
|
||
things.setRotationPoint(0.0F, 22.0F, -3.0F); | ||
setRotationAngle(things, -0.48F, 0.0F, 0.0F); | ||
things.addBox(-0.5F, -1.0F, -6.0F, 1, 1, 5, 0.0F, false); | ||
|
||
orb = new Cube(48, 2); | ||
orb.setRotationPoint(0.0F, 22.0F, -3.0F); | ||
setRotationAngle(orb, -0.48F, 0.0F, 0.0F); | ||
orb.addBox(-1.0F, -1.0F, -8.0F, 2, 2, 2, 0.0F, false); | ||
} | ||
|
||
@Override | ||
public void render(float limbSwing, float limbYaw, float ticksExisted, float headYaw, float headPitch, float scale) { | ||
this.setRotationAngles(limbSwing, limbYaw, ticksExisted, headYaw, headPitch, scale); | ||
fish.render(scale); | ||
tail.render(scale); | ||
fin_r.render(scale); | ||
fin_l.render(scale); | ||
mouth_down.render(scale); | ||
mouth_up.render(scale); | ||
things.render(scale); | ||
orb.render(scale); | ||
} | ||
|
||
public void setRotationAngles(float limbSwing, float limbYaw, float ticksExisted, float headYaw, float headPitch, float scale) { | ||
this.fin_r.rotateAngleY = -0.6F + MathHelper.cos(ticksExisted * 0.5F) * -0.15F; | ||
this.fin_l.rotateAngleY = 0.6F + MathHelper.cos(ticksExisted * 0.5F) * 0.15F; | ||
this.tail.rotateAngleY = MathHelper.cos(ticksExisted * 0.5F) * -0.3F; | ||
} | ||
|
||
public void setRotationAngle(Cube modelRenderer, float x, float y, float z) { | ||
modelRenderer.rotateAngleX = x; | ||
modelRenderer.rotateAngleY = y; | ||
modelRenderer.rotateAngleZ = z; | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
src/main/java/baguchan/better_with_aquatic/entity/render/RenderAnglerFish.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 baguchan.better_with_aquatic.entity.render; | ||
|
||
import baguchan.better_with_aquatic.entity.EntityAnglerFish; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.render.entity.LivingRenderer; | ||
import net.minecraft.client.render.model.ModelBase; | ||
import org.lwjgl.opengl.GL11; | ||
|
||
public class RenderAnglerFish extends LivingRenderer<EntityAnglerFish> { | ||
public RenderAnglerFish(ModelBase modelbase, float shadowSize) { | ||
super(modelbase, shadowSize); | ||
this.setRenderPassModel(new AnglerFishModel()); | ||
} | ||
|
||
|
||
protected boolean setAnglerBrightness(EntityAnglerFish spider, int i, float f) { | ||
if (i == 0) { | ||
this.loadTexture("/assets/better_with_aquatic/entity/angler_fish_overlay.png"); | ||
float brightness = spider.getBrightness(1.0f); | ||
if (Minecraft.getMinecraft((Object) this).fullbright) { | ||
brightness = 1.0f; | ||
} | ||
float f1 = (1.0f - brightness) * 0.5f; | ||
GL11.glEnable(3042); | ||
GL11.glDisable(3008); | ||
GL11.glBlendFunc(770, 771); | ||
GL11.glColor4f(1.0f, 1.0f, 1.0f, f1); | ||
return true; | ||
} | ||
return false; | ||
} | ||
|
||
@Override | ||
protected boolean shouldRenderPass(EntityAnglerFish entity, int renderPass, float renderPartialTicks) { | ||
return this.setAnglerBrightness(entity, renderPass, renderPartialTicks); | ||
} | ||
} |
Binary file added
BIN
+662 Bytes
src/main/resources/assets/better_with_aquatic/entity/angler_fish.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+163 Bytes
src/main/resources/assets/better_with_aquatic/entity/angler_fish_overlay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+885 Bytes
src/main/resources/assets/better_with_aquatic/item/spawnEggDefault.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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