Skip to content

Commit

Permalink
Updated to 1.11.2
Browse files Browse the repository at this point in the history
  • Loading branch information
The-Fireplace committed Feb 25, 2017
1 parent 1db1a6b commit 5a826f6
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 44 deletions.
33 changes: 22 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
/*
!/src/
!.gitignore
!gradlew*
!/gradle/
!/LICENSE.txt
!/README.md
!/COPYING.lesser
!build.gradle
!/libs/
!/.gitlab-ci.yml
# eclipse
bin
*.launch
.settings
.metadata
.classpath
.project

# idea
out
*.ipr
*.iws
*.iml
.idea

# gradle
build
.gradle

# other
eclipse
run
20 changes: 16 additions & 4 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ variables:
CACHE_DIR: "$CI_PROJECT_DIR/build"
CACHE_DIR2: "$CI_PROJECT_DIR/.gradle"

ORIG_ARTIFACTS: "$CI_PROJECT_DIR/build/libs/HVII-1.10.2-*.jar"
ARTIFACTS: "$CI_PROJECT_DIR/HVII-1.10.2-*.jar"
ORIG_ARTIFACTS: "$CI_PROJECT_DIR/build/libs/HVII-1.11.2-*.jar"
ARTIFACTS: "$CI_PROJECT_DIR/HVII-1.11.2-*.jar"

cache:
paths:
Expand All @@ -21,10 +21,22 @@ deploy:
stage: deploy
script:
- ./gradlew clean
- ./gradlew build uploadArchives curseforge uploadToModsIO -PcurseForgeApiKey=$curseForgeApiKey -PmodsioApiKey=$modsioApiKey --continue
- ./gradlew build curseforge uploadToModsIO -PcurseForgeApiKey=$curseForgeApiKey -PmodsioApiKey=$modsioApiKey
- cp $ORIG_ARTIFACTS .
when: manual
artifacts:
name: "HVII-1.10.2-$(cat $CACHE_DIR/.version)"
name: "HVII-1.11.2-$(cat $CACHE_DIR/.version)"
paths:
- $ARTIFACTS

deployMaven:
stage: deploy
script:
- ./gradlew clean
- ./gradlew build uploadArchives curseforge uploadToModsIO -PcurseForgeApiKey=$curseForgeApiKey -PmodsioApiKey=$modsioApiKey
- cp $ORIG_ARTIFACTS .
when: manual
artifacts:
name: "HVII-1.11.2-$(cat $CACHE_DIR/.version)"
paths:
- $ARTIFACTS
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ apply plugin: 'maven-publish'

version = "1.0.0"
group= "the_fireplace.hvii"
archivesBaseName = "HVII-1.10.2"
archivesBaseName = "HVII-1.11.2"

allprojects {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}

minecraft {
version = "1.10.2-12.18.3.2221"
version = "1.11.2-13.20.0.2251"
runDir = "run"
replace '${version}', project.version
mappings = "stable_29"
mappings = "snapshot_20170223"
}

processResources
Expand Down Expand Up @@ -95,7 +95,7 @@ curseforge {
id = '261354'
changelog = file('changelog.txt')
releaseType = 'release'
addGameVersion '1.10.2'
addGameVersion '1.11.2'
addGameVersion 'Java 8'
mainArtifact(jar) {
displayName = jar.archiveName.replace(".jar", "")
Expand All @@ -116,7 +116,7 @@ modsIO {
project{
artifact = new File(jar.destinationDir, archivesBaseName+"-"+version+".jar")
modid = "1255"
minecraft = "1.10.2"
minecraft = "1.11.2"
try{changelog = file('changelog.txt').text}catch(Exception e){changelog=""}
tag = ""
current = true
Expand Down
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Updated to 1.11.2
26 changes: 19 additions & 7 deletions src/main/java/the_fireplace/hvii/ForgeEvents.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package the_fireplace.hvii;

import net.minecraft.client.Minecraft;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumHand;
import net.minecraftforge.event.entity.living.LivingEvent;
Expand All @@ -25,12 +27,22 @@ public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent eventArgs) {
}
@SubscribeEvent
public void livingUpdate(LivingEvent.LivingUpdateEvent event) {
if (ArrayUtils.contains(ConfigValues.GLOWINGENTITIES, event.getEntity().getClass().getSimpleName())){
if (!event.getEntityLiving().isGlowing())
event.getEntityLiving().setGlowing(true);
}else{
if(event.getEntityLiving().isGlowing())
event.getEntityLiving().setGlowing(false);
if(EntityList.getKey(event.getEntityLiving()) != null) {
if (ArrayUtils.contains(ConfigValues.GLOWINGENTITIES, EntityList.getKey(event.getEntityLiving()).getResourcePath())) {
if (!event.getEntityLiving().isGlowing())
event.getEntityLiving().setGlowing(true);
} else {
if (event.getEntityLiving().isGlowing())
event.getEntityLiving().setGlowing(false);
}
}else if(event.getEntityLiving() instanceof EntityPlayer){
if (ArrayUtils.contains(ConfigValues.GLOWINGENTITIES, "player")) {
if (!event.getEntityLiving().isGlowing())
event.getEntityLiving().setGlowing(true);
} else {
if (event.getEntityLiving().isGlowing())
event.getEntityLiving().setGlowing(false);
}
}
}

Expand All @@ -43,7 +55,7 @@ public void renderTick(TickEvent.RenderTickEvent t){
if(partial % ConfigValues.TPU == 0)
if(Minecraft.getMinecraft().player != null) {
ItemStack heldItem = Minecraft.getMinecraft().player.getHeldItem(EnumHand.MAIN_HAND);
if (heldItem != null)
if (!heldItem.isEmpty())
if (PATSRegistry.getHandlerFor(heldItem) != null) {
if(!PATSRegistry.getHandlerFor(heldItem).isThrown(heldItem) || PATSRegistry.showThrown)
PATSRegistry.getHandlerFor(heldItem).handleRender(Minecraft.getMinecraft(), ConfigValues.ENABLE_PATS_PRIMARY, ConfigValues.ENABLE_PATS_SECONDARY, ConfigValues.ATD, HVII.primary, HVII.secondary, ConfigValues.EXTENSIVE_PATS_SECONDARY, 0.0F);
Expand Down
32 changes: 16 additions & 16 deletions src/main/java/the_fireplace/hvii/config/GuiChooseEntities.java
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
package the_fireplace.hvii.config;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.util.ResourceLocation;
import org.apache.commons.lang3.ArrayUtils;
import the_fireplace.hvii.HVII;

import java.awt.*;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Map;

/**
* @author The_Fireplace
Expand All @@ -29,9 +28,9 @@ public class GuiChooseEntities extends GuiScreen {

private int page;
private final int max_page;
private final ArrayList<Class<? extends Entity>> allMobs;
private final ArrayList<ResourceLocation> allMobs;
private String[] tmpMobs;
private final Class<? extends Entity>[] currentlyShownMobs;
private final ResourceLocation[] currentlyShownMobs;

private static final ResourceLocation resource = new ResourceLocation(HVII.MODID, "textures/gui/guichooseentities.png");

Expand All @@ -42,12 +41,12 @@ public GuiChooseEntities(){
width=xSize;

allMobs = new ArrayList<>();
for (final Map.Entry<String, Class<? extends Entity>> entry : EntityList.NAME_TO_CLASS.entrySet()) {
allMobs.add(entry.getValue());
for (ResourceLocation entry : EntityList.getEntityNameList()) {
if(EntityList.createEntityByIDFromName(entry, Minecraft.getMinecraft().world) instanceof EntityLiving)
allMobs.add(entry);
}
allMobs.remove(EntityLiving.class);
allMobs.add(EntityPlayerMP.class);
currentlyShownMobs = new Class[8];
allMobs.add(new ResourceLocation("player"));
currentlyShownMobs = new ResourceLocation[8];
page = 0;
max_page = (allMobs.size() / 8)
+ (((allMobs.size() % 8) == 0) ? -1 : 0);
Expand Down Expand Up @@ -92,9 +91,9 @@ protected void actionPerformed(GuiButton button){
if(button instanceof ToggleButton){
boolean flag = ((ToggleButton) button).toggled;
if(flag){
tmpMobs = ArrayUtils.remove(tmpMobs, ArrayUtils.indexOf(tmpMobs, currentlyShownMobs[button.id-2].getSimpleName()));
tmpMobs = ArrayUtils.remove(tmpMobs, ArrayUtils.indexOf(tmpMobs, currentlyShownMobs[button.id-2].getResourcePath()));
}else{
tmpMobs = ArrayUtils.add(tmpMobs, currentlyShownMobs[button.id-2].getSimpleName());
tmpMobs = ArrayUtils.add(tmpMobs, currentlyShownMobs[button.id-2].getResourcePath());
}
((ToggleButton) button).toggled=!flag;
}else{
Expand Down Expand Up @@ -138,7 +137,8 @@ public void drawScreen(int mouseX, int mouseY, float partialTicks) {
RenderHelper.enableStandardItemLighting();

for (int x=0;x<8;x++){
drawString(fontRendererObj, currentlyShownMobs[x] == EntityPlayerMP.class ? "Player" : EntityList.getEntityStringFromClass(currentlyShownMobs[x]), guiLeft+24, guiTop+10+x*18, 0xFFFFFF);
if(currentlyShownMobs[x] != null)
drawString(fontRenderer, currentlyShownMobs[x].getResourcePath(), guiLeft+24, guiTop+10+x*18, Color.WHITE.getRGB());
}
}

Expand All @@ -155,7 +155,7 @@ private void setMobs() {
buttonList.get(1).enabled = page != max_page;

final int length = allMobs.size();
final Class[] keys = allMobs.toArray(new Class[]{});
final ResourceLocation[] keys = allMobs.toArray(new ResourceLocation[]{});
final int page4 = page * 8;

if ((page == max_page) && (length != ((max_page - 1) * 8))) {
Expand All @@ -168,7 +168,7 @@ private void setMobs() {
currentlyShownMobs[i-2] = keys[tmp];
buttonList.get(i).enabled = true;
buttonList.get(i).visible = true;
((ToggleButton)buttonList.get(i)).toggled= ArrayUtils.contains(tmpMobs, currentlyShownMobs[i-2].getSimpleName());
((ToggleButton)buttonList.get(i)).toggled= ArrayUtils.contains(tmpMobs, currentlyShownMobs[i-2].getResourcePath());
} else {
currentlyShownMobs[i-2] = null;
buttonList.get(i).enabled = false;
Expand All @@ -181,7 +181,7 @@ private void setMobs() {
currentlyShownMobs[i-2] = keys[i + page4];
buttonList.get(i).enabled = true;
buttonList.get(i).visible = true;
((ToggleButton)buttonList.get(i)).toggled= ArrayUtils.contains(tmpMobs, currentlyShownMobs[i-2].getSimpleName());
((ToggleButton)buttonList.get(i)).toggled= ArrayUtils.contains(tmpMobs, currentlyShownMobs[i-2].getResourcePath());
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/mcmod.info
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "Hacker Voice: I'm In (HVII)",
"description": "A mod adding various client-side tweaks.",
"version": "${version}",
"mcversion": "1.10.2",
"mcversion": "1.11.2",
"url": "https://mods.curse.com/mc-mods/minecraft/261354-hacker-voice-im-in-hvii",
"updateUrl": "https://mods.curse.com/mc-mods/minecraft/261354-hacker-voice-im-in-hvii",
"authorList": ["The_Fireplace"],
Expand Down

0 comments on commit 5a826f6

Please sign in to comment.