Skip to content

Instantly share code, notes, and snippets.

@Corosauce
Corosauce / gist:d309e298ee71e9312a8be639a7c28060
Created June 22, 2019 06:09
AI mutex bits, 1.12 to 1.14
1 -> Goal.Flag.MOVE
2 -> Goal.Flag.LOOK
4 -> Goal.Flag.JUMP
8 -> Goal.Flag.TARGET (this one is new, 1.12 never had or used this)
new using multiple example: this.setMutexFlags(EnumSet.of(Goal.Flag.MOVE, Goal.Flag.LOOK, Goal.Flag.JUMP));
---- Minecraft Crash Report ----
// Sorry :(
Time: 10/21/18 11:57 PM
Description: Rendering screen
java.lang.NullPointerException: Rendering screen
at net.tropicraft.core.common.item.scuba.api.IScubaTank.serializeNBT(IScubaTank.java:21)
at net.tropicraft.core.common.item.scuba.ItemScubaTank$1.setAirType(ItemScubaTank.java:57)
at net.tropicraft.core.common.item.scuba.api.IScubaTank.deserializeNBT(IScubaTank.java:28)
@Corosauce
Corosauce / gist:46ee07b8ed9fecff76a93a0ecd76263a
Created June 30, 2018 17:12
clean example of spin entity around other entity
if (ent instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) ent;
List<EntityLivingBase> ents = ent.world.getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(ent.getPosition()).grow(10, 10, 10));
for (Entity entToSpin : ents) {
//get the vector of x and z
double vecX = player.posX - entToSpin.posX;
double vecZ = player.posZ - entToSpin.posZ;
//atan2 will give you the angle for yaw, for how minecraft works this will be 90 degrees off from an angle that will aim it directly at center entity
float yawDegrees = (float)(Math.toDegrees(Math.atan2(vecZ, vecX)));
//make the spin a bit tighter around the center entity, subtracting a full 90 degrees pulls it right towards you
- Slanty rain! Angles in direction of wind
- Rain is whiter, how it spawns reworked for more consistancy
- Rain shouldnt leak through cielings/inside areas anymore
- Fix for sub 20 fps runaway performance issue
- Fix for active weather machines spawning loose storm on world reload
- Fix for storms right on the edge of the simbox being insta despawned causing spawn/despawn spam
- Fixed all clouds getting removed instantly as soon as dedicated server starts, now waits for 30 seconds before seeing if no players around before removing them
- Clouds avoid mountains now
- New configs for setting min and max cloud coverage, allows for ranges outside 0-100% for locking it to 0 or 100%
- more dynamic rain stages
- blizzards similar to sandstorms
- a hybrid mode for global overcast / local biomes mode that makes it more mod friendly while still appearing to have local weather
- inner cloud lightning
- different lightning/thunder visual and sound
- downbursts/microbursts
- a system to support more varied real storm/tornado/cloud types
- experiment with weather simulation on a larger scale, using biome temps to get averages of climate in areas
- rework hurricanes
-- flash flooding using threaded simulation system to do mass water/block updates over time
@Corosauce
Corosauce / gist:13439d107b36d8ddb5f1dec0117bf6b8
Created January 16, 2017 01:28
Tropiserver 7.0 Instructions
Tropiserver 7.0 Instructions
----------------------------
- Downlawd https://dl.dropboxusercontent.com/u/16326915/Tropiserver%207.0%20-%20FTB%20Infinity%20Evolved-2.6.0.zip
- Go to curse, minecraft tab, create custom profile
- Click the barely visible "import" link in the sentance "Or import a previously exported profile"
- Point it to downloaded zip
- Let it install
- Run
- Die
My video has been improperly tagged as using this song: https://www.youtube.com/watch?v=QF77vALIbxk
Nowhere in my video is this song used, the song does however use a siren sound effect right at the start, this sound is licensed under the Creative Commons license and is free to distribute and modify, the source of the sound and license is available here: http://www.freesound.org/people/IFartInUrGeneralDirection/sounds/46092/
The software used in my video also uses this sound, as mentioned here: https://github.com/Corosauce/weather2/blob/1.10.x/LICENSE%20INFO.txt
I believe this is the cause of the false copyright claim on my video and the claim should be removed
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void tickClient(ClientTickEvent event) {
try {
if (Minecraft.getMinecraft().currentScreen instanceof GuiInventory) {
GuiInventory gui = (GuiInventory) Minecraft.getMinecraft().currentScreen;
Slot slot = gui.getSlotUnderMouse();
if (slot != null) {
int guiLeft = ObfuscationReflectionHelper.getPrivateValue(GuiContainer.class, gui, "guiLeft");
int guiTop = ObfuscationReflectionHelper.getPrivateValue(GuiContainer.class, gui, "guiTop");
float radius = 5F;
int lats = 10;
int longs = 10;
//quad based Icosahedron
int i, j;
for (i = 0; i <= lats; i++) {
double lat0 = Math.PI * (-0.5D + (double) (i - 1) / lats);
double z0 = Math.sin(lat0);
double zr0 = Math.cos(lat0);
public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
{
par3 = MathHelper.cos(rotationYaw * (float)Math.PI / 180.0F);
par5 = MathHelper.sin(rotationYaw * (float)Math.PI / 180.0F);
par6 = -par5 * MathHelper.sin(rotationPitch * (float)Math.PI / 180.0F);
par7 = par3 * MathHelper.sin(rotationPitch * (float)Math.PI / 180.0F);
par4 = MathHelper.cos(rotationPitch * (float)Math.PI / 180.0F);