Skip to content

Instantly share code, notes, and snippets.

View SanAndreaP's full-sized avatar
💃

SanAndreaP SanAndreaP

💃
View GitHub Profile
package sanandreasp.core.manpack.helpers;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Map;
import com.google.common.collect.Maps;
import cpw.mods.fml.relauncher.ReflectionHelper.UnableToAccessFieldException;
2014-04-11 12:55:08 [INFO] [STDOUT] ----- REFLECTION: Test begins now!
2014-04-11 12:55:08 [INFO] [STDOUT] ----- access without reflection
2014-04-11 12:55:08 [INFO] [STDOUT] 6354
2014-04-11 12:55:08 [INFO] [STDOUT] 488
2014-04-11 12:55:08 [INFO] [STDOUT] 488
2014-04-11 12:55:08 [INFO] [STDOUT] 489
2014-04-11 12:55:08 [INFO] [STDOUT] 488
2014-04-11 12:55:08 [INFO] [STDOUT] 489
2014-04-11 12:55:08 [INFO] [STDOUT] 0
2014-04-11 12:55:08 [INFO] [STDOUT] 489
public class Event
{
// texture is in
// assets/examplemod/textures/blocks/ani.png
// assets/examplemod/textures/blocks/ani.png.mcmeta
public static TextureTestBlock ttestblk = new TextureTestBlock("examplemod:ani");
@SubscribeEvent
public void textureStitchPre(TextureStitchEvent.Pre event) {
if( event.map.getTextureType() == 0 ) { // 0 for the terrain.png (block icons)
@SanAndreaP
SanAndreaP / gist:4b8fc3a46ab0a6aeaa04
Created November 27, 2014 11:00
How to make the biome changer more "challenging"
So the idea is to have the biome changer use less GUIs, which brings forth following concept on how
to tell the biome changer which biome to use:
- You have this block called "Biome Data Crystal" which needs to be charged with the data of the
respective biome you want to have
- To charge it said data, you need to place it down on the ground of the desirable biome and it will
slowly "fill up" with the biome data
- Once filled up, you can then place it on the ground on another biome which you want to convert to
the biome saved in the crystal and on top the biome changer
- Fill up the biome changer with RF and activate it. It now converts the biome to the desired one
- You can empty the crystal by simply washing it in a cauldron (it will take up water like dyed
@SanAndreaP
SanAndreaP / gist:b263aba08e4076c68b9c
Last active August 29, 2015 14:10
Biome Changer functionality
Here's the new Biome Changer functionality (with its BiomeChangerCrystal) explained:
The Biome Data Crystal
======================================
A crystal can have up to 10 "bytes" of biome data. When placed empty or non-full (and has not the
"used" state, explained later), it will fill up 1 byte at a time until it reaches the "filled" state.
The speed of this process is determined by the light value it receives, the higher the light value,
the faster it fills up (1). On the other hand, when it's completely dark (light value of 0), it won't
charge anything.
You can break it with your bare hands, which drops itself (with the data obviously).
@SanAndreaP
SanAndreaP / SAPClientUtils.java
Created December 12, 2014 14:18
Pendulum Wave for your TESR / any dynamic Tessellator rendering
// draws a solid square on the Z-Plane, facing to the positive Z-direction
public static void drawSquareZPos(double cornerBeginX, double cornerBeginY, double cornerEndX, double cornerEndY, double z) {
Tessellator tess = Tessellator.instance;
GL11.glEnable(GL11.GL_BLEND);
GL11.glDisable(GL11.GL_TEXTURE_2D);
OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
tess.startDrawingQuads();
tess.setNormal(0.0F, 0.0F, 1.0F);
@SanAndreaP
SanAndreaP / IslandManager.java
Last active August 29, 2015 14:12
IslandManager.java
/*******************************************************************************************************************
* Authors: SanAndreasP
* Copyright: SanAndreasP
* License: Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International
* http://creativecommons.org/licenses/by-nc-sa/4.0/
*******************************************************************************************************************/
package de.sanandrew.mods.enderstuffp.util.manager;
import cpw.mods.fml.common.FMLLog;
import de.sanandrew.mods.enderstuffp.util.EnderStuffPlus;
@SanAndreaP
SanAndreaP / RenderCubeISBRH.java
Created March 18, 2015 13:49
A method to render a rotate-able cube (w/o texture) in an ISBRH. It uses vectors to calculate the cube corner coords, which makes the rotation possible.
public void renderCubeVec(double x, double y, double z, double sizeX, double sizeY, double sizeZ, float rotX, float rotY, float rotZ, RenderBlocks renderer) {
Tessellator tess = Tessellator.instance;
rotX = (float) ((rotX / 180.0F) * Math.PI);
rotY = (float) ((rotY / 180.0F) * Math.PI);
rotZ = (float) ((rotZ / 180.0F) * Math.PI);
Vec3 vec1 = Vec3.createVectorHelper(sizeX, 0.0D, 0.0D);
Vec3 vec2 = Vec3.createVectorHelper(0.0D, sizeY, 0.0D);
Vec3 vec3 = Vec3.createVectorHelper(0.0D, 0.0D, -sizeZ);
@SanAndreaP
SanAndreaP / TurretIdeas.txt
Last active August 29, 2015 14:19
Possible Turret Upgrade Ideas
#1 Mana (name not decided yet; req. Botania)
consumes a specific amount of mana per HP healed from nearby mana pools to act
as "ammo" instead of glistering melons
[20:37:17.660] [Info] Root: Preparing Root...
[20:37:17.664] [Info] Root: Done preparing Root.
[20:37:17.664] [Info] Client Version 1.1.0 (windows x86_64) Source ID: eb229dcd10aad142c4b79af6c5b8dc8d39e7d792 Protocol: 724
[20:37:17.664] [Info] Root: Scanning for asset sources in directory '..\assets\'
[20:37:17.664] [Info] Root: Skipping hidden '_unpacked' in asset directory
[20:37:18.123] [Info] Root: Scanning for asset sources in directory '..\mods\'
[20:37:18.123] [Warn] Root: Unrecognized file in asset directory 'mods_go_here', skipping
[20:37:18.123] [Info] Root: Detected asset source named 'base' at '..\assets\packed.pak'
[20:37:18.123] [Info] Root: Detected unnamed asset source at '..\assets\user'
[20:37:18.123] [Info] Loading assets from: '..\assets\packed.pak'