Skip to content

Commit

Permalink
Redo the GameHooks tutorial.
Browse files Browse the repository at this point in the history
  • Loading branch information
iChun committed May 30, 2021
1 parent 1cf6709 commit 5c24aec
Show file tree
Hide file tree
Showing 12 changed files with 334 additions and 26 deletions.
88 changes: 88 additions & 0 deletions docs/expert/files/gamehooks/gamehooks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{
"listeners": [
{
"className": "LivingAttackEvent",
"isServerEvent": true,
"staticAccessors": [
{
"name": "Vector3d:init",
"function": "<>",
"paramInjectors": [
{
"isPrimitive": true,
"classType": "double",
"argToPull": "0"
},
{
"isPrimitive": true,
"classType": "double",
"argToPull": "1.5"
},
{
"isPrimitive": true,
"classType": "double",
"argToPull": "0"
}
],
"classForStaticAccess": "net.minecraft.util.math.vector.Vector3d",
"argName": "velocity"
}
],
"accessors": [
{
"name": "ForgeEvent:getEntityLiving",
"function": "getEntityLiving()",
"instanceCheck": "net.minecraft.entity.passive.PigEntity",
"nextAccessors": [
{
"name": "Entity:world",
"function": "field_145850_b",
"nextAccessors": [
{
"name": "World:isRemote",
"function": "field_72995_K",
"postAccessorEvent": {
"conditions": [
{
"variableName": "isRemote",
"variableResult": "true",
"type": "variableCheck"
}
],
"outcomes": [
{
"condition": {
"variableName": "stopEventProcessing",
"variableInput": "",
"type": "variableInsert"
},
"outcome": {
"type": "null"
},
"type": "conditional"
}
]
},
"argName": "isRemote"
}
]
},
{
"name": "Entity:setMotion",
"function": "func_213317_d()",
"paramInjectors": [
{
"classType": "net.minecraft.util.math.vector.Vector3d",
"argToPull": "velocity"
}
]
}
],
"argName": "pigEntity"
}
],
"argBasedAccessors": {},
"cancel": "true"
}
]
}
264 changes: 242 additions & 22 deletions docs/expert/gamehooks.md

Large diffs are not rendered by default.

Binary file added docs/expert/images/gamehooks/checkpoint1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/expert/images/gamehooks/completion.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/expert/images/gamehooks/getentityworld.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/expert/images/gamehooks/isremote.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/expert/images/gamehooks/objectaccessor.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/expert/images/gamehooks/setmotion.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/expert/images/gamehooks/vector3d.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions theme/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<meta name="theme-color" content="#ffffff">

<link rel="stylesheet" href="https://use.fontawesome.com/a1f20be65b.css">
<link rel="stylesheet" href="{{ base_url }}/css/styles_dark.css?version=2" data-theme="dark">
<link rel="stylesheet" href="{{ base_url }}/css/styles_light.css?version=2" data-theme="light">
<link rel="stylesheet" href="{{ base_url }}/css/styles_dark.css?version=3" data-theme="dark">
<link rel="stylesheet" href="{{ base_url }}/css/styles_light.css?version=3" data-theme="light">
<link rel="stylesheet" href="{{ base_url }}/css/img_center.css">

{% for path in extra_css %}
Expand Down
2 changes: 1 addition & 1 deletion theme/css/styles_dark.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion theme/css/styles_light.css

Large diffs are not rendered by default.

0 comments on commit 5c24aec

Please sign in to comment.