Skip to content

Commit

Permalink
More code cleanup, bug fixes & documentation
Browse files Browse the repository at this point in the history
2^6th commit! It's been over a month since this port started, and I'm getting closer to the first official release! This commit has been somewhat focused on code cleanup & documentation. I've also fixed the fire bow not shooting fire arrows, and changed some of the bow values (I still need to do a re-check of all of them!), as well as re-doing the README. Additionally, I've removed some fairly stale commented out debug code, and worked on some basic error handling. Plus, if you look hard enough, you might spot some currently unused code scattered among these changes...
  • Loading branch information
NeRdTheNed committed Nov 5, 2020
1 parent ddc7a13 commit fc474fa
Show file tree
Hide file tree
Showing 9 changed files with 219 additions and 164 deletions.
39 changes: 15 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,29 @@
[![Licence badge](https://img.shields.io/github/license/NeRdTheNed/More-bows "Licence")](https://github.com/NeRdTheNed/More-bows/blob/master/LICENSE)
[![Java SE version compatibility badge](https://img.shields.io/badge/Java%20SE-5-orange?logo=java "Java SE version compatibility")](https://en.wikipedia.org/wiki/Java_version_history#J2SE_5.0)

### _This port is not finished yet! Stay tuned for progress on it, and feel free to check out the latest dev builds!_
**_This port is currently in beta, so things might still be incomplete or break! Stay tuned for progress on it, and feel free to check out the latest builds!_**

<p align="center"> <img src="https://raw.githubusercontent.com/NeRdTheNed/More-bows/master/src/main/resources/mb.jpg" alt="More Bows Logo" title="More Bows!" style='width: 100%; object-fit: contain'/> </p>

This is a port of the More Bows mod to 1.7.10! This mod was originally created by GaussFire, and then maintained & updated by iDiamondhunter. This port aims to faithfully re-create the original mod, while fixing some bugs & then potentially introducing new mechanics (or re-adding cut ideas!).
This is a port of the More Bows mod to 1.7.10! This mod was originally created by GaussFire, and then maintained & updated by iDiamondhunter. This port aims to faithfully re-create the original mod, while fixing some bugs & potentially introducing new mechanics (or re-adding cut ideas!).

Other people's ports:
- LucidSage's port of the More Bows mod to 1.8 can be found [here](https://github.com/LucidSage/More-bows)!

## Progress: Most things (barely) work!
### Original descriptions of each bow (not currently 100% accurate!):

Issues / TODO list:
- Reinforced Bow ![Reinforced Bow Icon](https://raw.githubusercontent.com/NeRdTheNed/More-bows/master/src/main/resources/assets/morebows/textures/items/StoneBow1.png): This bow is just like the regular wooden bow, but has more durability.
- Iron Bow ![Iron Bow Icon](https://raw.githubusercontent.com/NeRdTheNed/More-bows/master/src/main/resources/assets/morebows/textures/items/IronBow1.png): This bow is a step up from the reinforced bow, having slightly more damage and durability, along with a minuscule upgrade of draw speed.
- Golden Bow ![Golden Bow Icon](https://raw.githubusercontent.com/NeRdTheNed/More-bows/master/src/main/resources/assets/morebows/textures/items/GoldBow1.png): The bow forged of gold: it has a pathetic amount of uses but overall does the most damage. Quick reflexes allow you to shoot at double the speed!
- Crystal Bow ![Crystal Bow Icon](https://raw.githubusercontent.com/NeRdTheNed/More-bows/master/src/main/resources/assets/morebows/textures/items/DiamondBow1.png): A bow sealed with the power of diamond, not many can survive it's swift and damaging moves. With a diamond base, you don't need to worry about over-pulling, this bow also doubles your draw speed!
- Blazing Bow ![Blazing Bow Icon](https://raw.githubusercontent.com/NeRdTheNed/More-bows/master/src/main/resources/assets/morebows/textures/items/FlameBow1.png): A bow from the horrible pits of the Nether, the power of fire emanates from the weapon in your hand. With this bow, you can do double the damage of a normal bow, while setting your foes alight!
- Ender Bow ![Ender Bow Icon](https://raw.githubusercontent.com/NeRdTheNed/More-bows/master/src/main/resources/assets/morebows/textures/items/EnderBow1.png): A mysterious bow with the secrets of the Ender within. Along with having a slow drawback, it will use the Ender's technique to shoot a regular arrow that will not damage anything but, after 3 seconds, will summon 5 more arrows to kill it's opponents.
- Legia Bow ![Legia Bow Icon](https://raw.githubusercontent.com/NeRdTheNed/More-bows/master/src/main/resources/assets/morebows/textures/items/MultiBow1.png): The final and most overwhelming bow, it delivers fast and many blows to its enemies. Even with two arrows, your draw speed will be faster than the iron bow!
- Frost Bow ![Frost Bow Icon](https://raw.githubusercontent.com/NeRdTheNed/More-bows/master/src/main/resources/assets/morebows/textures/items/FrostBow1.png): Bonus bow for Christmas! Present for everyone who was supporting (iDiamondhunter) with the mod! This bow makes entities go slowly but its draw speed is awful. It also spawns a snow layer on impact, and freezes water!

- <s>![Ender Bow Icon](https://raw.githubusercontent.com/NeRdTheNed/More-bows/master/src/main/resources/assets/morebows/textures/items/EnderBow1.png) **The ender bow can currently cause ConcurrentModificationExceptions and crash your game!** ![Ender Bow Icon](https://raw.githubusercontent.com/NeRdTheNed/More-bows/master/src/main/resources/assets/morebows/textures/items/EnderBow1.png) This bow really is _still_ in development, so beware of it! (That being said, it doesn't freeze the entire game for 3 seconds anymore.) The ConcurrentModificationExceptions will be fixed when I re-write that code to not use my janky multi-threading, as Minecraft is not a thread-safe game.</s> A fix has been implemented, but it's somewhat WIP! I'll tidy it up and fix all the new bugs...
- <s>The bow animations are all the same speed, and don't reflect how fast you're actually drawing the bow.</s> Still working on it, not accurate yet.
- The frost arrow renders as a normal arrow instead of a snow cube.
- Frost arrows will re-freeze or re-snow bits of the world when reloaded.
- <s>Particle effects are hit-or-miss on whether they work due to me not implementing sided proxies yet.</s> Fixed, who needs sided proxies when you have server worlds!
- Arrows will "shoot backwards" when shot at extremely low velocities (shot as soon as possible) from certain bows.
Descriptions taken from [iDiamondhunter's page for the mod](https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/minecraft-mods/1286765-1-6-2-more-bows-mod).

Not technically an issue but should be fixed:

- My code is very hacky in a few places. I need to clean it up by re-writing a bunch of classes, <s>and also need to be even hackier in some places to remove the access transformer I've used.</s> Those particular hacks are now implemented! Also - better documentation is needed!
- The Legia Bow still shoots arrows at weird angles, just like in the original. I'll fix this once the mod is completely ported over.
- Similarly, ender arrows might not be completely centered.
- <s>Run optipng over all assets. Figure out if anything can be done to the .JPEGs without losing any quality.</s> Still working on the mod icon, but mostly done! Additionally, make the mod icon transparent.
- Find out if there were ever any translations of this mod.
- <s>Check and update any assets that have mutated too much over the years.</s> Partially done. Bow art matches perfectly (except for versions of the mod that accidentally cut off bits of the images), including with the earliest version of the mod I could find (More Bows for 1.2.5 v2, images verified with ImageMagick). I still need to verify the frost bow art with different versions of iDiamondhunter's ports.
- The README needs some tidying up as well. I should probably switch the image links to relative links.
- More stuff I still need to write down here!
### Other people's ports:
- LucidSage's port of the More Bows mod to 1.8 can be found [here](https://github.com/LucidSage/More-bows)!

Licence:
### Licence:
As iDiamondhunter ["removed the copyrights" from this mod](https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/minecraft-mods/1286765-1-6-2-more-bows-mod?comment=733), I presume that this mod is free of any known copyright, and that it is in the public domain. Therefore, I will be keeping it licensed as such.

<p align="center"> <img src="https://raw.githubusercontent.com/NeRdTheNed/More-bows/master/docs/images/1-7-10.png" alt="CurseForge user the_spider_overlord: dangit if only this had a 1.7.10 backport!" title="Did someone say backport???" style='width: 100%; object-fit: contain'/> </p>
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
minecraft_version=1.7.10
forge_version=10.13.4.1558-1.7.10
mod_version=1.0.0-beta.1
mod_version=1.0.0-beta.2
mod_group=iDiamondhunter.morebows
mod_name=More Bows
55 changes: 52 additions & 3 deletions src/main/java/iDiamondhunter/morebows/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,30 @@

import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import iDiamondhunter.morebows.bows.CustomBow;
import iDiamondhunter.morebows.client.NoRender;
import iDiamondhunter.morebows.entities.ArrowSpawner;
import net.minecraft.client.renderer.entity.RenderSnowball;
import net.minecraft.init.Items;
import net.minecraftforge.client.event.FOVUpdateEvent;

/* import org.lwjgl.opengl.GL11;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.event.RenderPlayerEvent.Specials.Pre; */

/* import net.minecraft.client.renderer.entity.RenderSnowball;
import net.minecraft.init.Items; */

public class Client extends MoreBows {

/** Handles the FOV "zoom in" when drawing a custom bow */
@SubscribeEvent
@SideOnly(value = Side.CLIENT)
public void FOVUpdate(FOVUpdateEvent event) {
if ((event.entity.getItemInUse() != null) && (event.entity.getItemInUse().getItem() instanceof CustomBow)) {
// See net.minecraft.client.entity.EntityPlayerSP.getFOVMultiplier()
/** See net.minecraft.client.entity.EntityPlayerSP.getFOVMultiplier() */
final CustomBow bow = (CustomBow) event.entity.getItemInUse().getItem();
float f1 = (float) event.entity.getItemInUseDuration() / (float) (bow.iconTimes[0] * (10 / 9));

Expand All @@ -28,10 +39,48 @@ public void FOVUpdate(FOVUpdateEvent event) {
}
}

/* What's this? An unfinished future feature, not enabled in this commit due to potential bugs? Sneaky... */
/*@SubscribeEvent
@SideOnly(value = Side.CLIENT)
public void playerRenderEvent(Pre event) {
final EntityPlayer player = event.entityPlayer;
if ((player.getItemInUse() != null) && (player.getItemInUse().getItem() instanceof CustomBow)) {
// We'll handle it.
event.renderItem = false;
// Get the item to render
final ItemStack currItem = player.inventory.getCurrentItem();
// Start the OpenGL stuff
GL11.glPushMatrix();
event.renderer.modelBipedMain.bipedRightArm.postRender(0.0625F);
GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F);
final float scale = 0.625F;
GL11.glTranslatef(0.0F, 0.125F, 0.3125F);
GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F);
GL11.glScalef(scale, -scale, scale);
GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
// Get the RBG value
final int itemColor = currItem.getItem().getColorFromItemStack(currItem, 0);
// Split the RGB values
final float red = ((itemColor >> 16) & 255) / 255.0F;
final float green = ((itemColor >> 8) & 255) / 255.0F;
final float blue = (itemColor & 255) / 255.0F;
final float alpha = 1.0F;
GL11.glColor4f(red, green, blue, alpha);
// I think this is actually the best way to do this, which is just super cursed.
Minecraft.getMinecraft().entityRenderer.itemRenderer.renderItem(event.entityLiving, currItem, 0);
// GL is gone. Who needs it anyway?
GL11.glPopMatrix();
}
}*/

@Override
protected void registerEntities() {
super.registerEntities();
// Handles not rendering the arrow spawner
RenderingRegistry.registerEntityRenderingHandler(ArrowSpawner.class, new NoRender());
/* TODO Re-implement */
//RenderingRegistry.registerEntityRenderingHandler(FrostArrow.class, new RenderSnowball(Items.snowball));
}

Expand Down
Loading

0 comments on commit fc474fa

Please sign in to comment.