Skip to content

Instantly share code, notes, and snippets.

View natanfudge's full-sized avatar

Natan Lifshitz natanfudge

View GitHub Profile
package battlePackage;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
public class BattleSimulator {
tiny 2 0 intermediary named
c net/minecraft/class_3720 net/minecraft/block/entity/BlastFurnaceBlockEntity
c net/minecraft/class_3721 net/minecraft/block/entity/BellBlockEntity
f Lnet/minecraft/class_2350; field_17097 lastSideHit
m ()V method_20522 playResonateSound
f I field_17095 ringTicks
m (Lnet/minecraft/class_2350;)V method_17031 activate
f Z field_17096 isRinging
c net/minecraft/class_3722 net/minecraft/block/entity/LecternBlockEntity
m ()I method_17524 getComparatorOutput

Communicating between the clients and the server

Experiment

Say you wanted to emit an explosion particle whenever your block is destroyed. Emitting particles requires access to the ParticleManager, which only exists on the MinecraftClient instance. Let's try doing that:

public class MyBlock extends Block {
@natanfudge
natanfudge / CvarRegistry old
Created November 10, 2019 12:14
Old classfiles
Classfile /C:/Users/natan/Desktop/cfg-remapped-.5/therealfarfetchd/commoncfg/api/cmds/CvarRegistry.class
Last modified Nov 10, 2019; size 1109 bytes
MD5 checksum 3486f3aa8ac840e5e6bd8fe77077045e
Compiled from "CvarRegistry.kt"
public interface therealfarfetchd.commoncfg.api.cmds.CvarRegistry
minor version: 0
major version: 52
flags: ACC_PUBLIC, ACC_INTERFACE, ACC_ABSTRACT
Constant pool:
#1 = Utf8 therealfarfetchd/commoncfg/api/cmds/CvarRegistry
@natanfudge
natanfudge / CvarRegistry$Mutable new
Created November 10, 2019 12:40
new cvarregistry
javap -v CvarRegistry$Mutable.class
Classfile /C:/Users/natan/Desktop/LogisticsPipes/.gradle/loom-cache/remapped_mods/net.fabricmc.yarn.19w45b.4.therealfarfetchd.qcommon.cfg-1.0.0-10/therealfarfetchd/commoncfg/api/cmds/CvarRegistry$Mutable.class
Last modified Nov 10, 2019; size 2857 bytes
MD5 checksum b80ab4e16309ef8b7aebecfc742c3aaa
Compiled from "CvarRegistry.java"
public interface therealfarfetchd.commoncfg.api.cmds.CvarRegistry$Mutable extends therealfarfetchd.commoncfg.api.cmds.CvarRegistry
minor version: 0
major version: 52
flags: ACC_PUBLIC, ACC_INTERFACE, ACC_ABSTRACT
Constant pool:
@natanfudge
natanfudge / CvarRegistry$Mutable old
Created November 10, 2019 12:44
CvarRegistry$Mutable old
javap -v CvarRegistry$Mutable.class
Classfile /C:/Users/natan/Desktop/LogisticsPipes/.gradle/loom-cache/remapped_mods/net.fabricmc.yarn.19w45b.4.therealfarfetchd.qcommon.cfg-1.0.0-10/therealfarfetchd/commoncfg/api/cmds/CvarRegistry$Mutable.class
Last modified Nov 10, 2019; size 2786 bytes
MD5 checksum 4607b4e2737052429440f3d8d7f9289a
Compiled from "CvarRegistry.kt"
public interface therealfarfetchd.commoncfg.api.cmds.CvarRegistry$Mutable extends therealfarfetchd.commoncfg.api.cmds.CvarRegistry
minor version: 0
major version: 52
flags: ACC_PUBLIC, ACC_INTERFACE, ACC_ABSTRACT
Constant pool:
+ artifact(remapSourcesJar)
- artifact(sourcesJar) {
- builtBy remapSourcesJar
- }
java -jar "procyon-decompiler-0.5.36 (1).jar" ProcyonBane.class
java.lang.ClassCastException: com.strobel.assembler.metadata.CoreMetadataFactory$MethodSignature cannot be cast to com.strobel.assembler.metadata.MethodReference
at com.strobel.decompiler.languages.java.utilities.TypeUtilities.getExpectedTypeByParent(TypeUtilities.java:365)
at com.strobel.decompiler.languages.java.utilities.RedundantCastUtility$IsRedundantVisitor.visitCastExpression(RedundantCastUtility.java:344)
at com.strobel.decompiler.languages.java.utilities.RedundantCastUtility$IsRedundantVisitor.visitCastExpression(RedundantCastUtility.java:167)
at com.strobel.decompiler.languages.java.ast.CastExpression.acceptVisitor(CastExpression.java:55)
at com.strobel.decompiler.languages.java.utilities.RedundantCastUtility.isCastRedundant(RedundantCastUtility.java:67)
at com.strobel.decompiler.languages.java.ast.transforms.InsertNecessaryConversionsTransform.visitCastExpression(InsertNecessaryConversion
java.lang.IllegalStateException: Calling invokeAndWait from read-action leads to possible deadlock.
at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:524)
at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:532)
at cloak.idea.platformImpl.IdeaPlatform.getFromUiThread(IdeaPlatform.kt:45)
at cloak.idea.platformImpl.IdeaPlatform.getAuthenticatedUser(IdeaPlatform.kt:235)
at cloak.git.YarnRepo.originUrl(YarnRepo.kt:63)
at cloak.git.YarnRepo.getOrCloneGit(YarnRepo.kt:130)
at cloak.git.YarnRepo.getOrCreateGit(YarnRepo.kt:32)
at cloak.git.YarnRepo$currentBranch$1.invokeSuspend(YarnRepo.kt:55)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
asdfasdfadsf